mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
Fixed crash on startup if a toolbar was floating when the application closed the previous time.
This commit is contained in:
parent
42151522fc
commit
0e0d352e6a
3 changed files with 7 additions and 4 deletions
|
@ -38,8 +38,8 @@ int stricmp(const char* str1, const char* str2);
|
|||
// Version number.
|
||||
#define LC_VERSION_MAJOR 0
|
||||
#define LC_VERSION_MINOR 82
|
||||
#define LC_VERSION_PATCH 0
|
||||
#define LC_VERSION_TEXT "0.82"
|
||||
#define LC_VERSION_PATCH 1
|
||||
#define LC_VERSION_TEXT "0.82.1"
|
||||
|
||||
// Forward declarations.
|
||||
class Project;
|
||||
|
|
|
@ -34,7 +34,9 @@ void PiecePreview::OnDraw()
|
|||
float aspect = (float)mWidth/(float)mHeight;
|
||||
mContext->SetViewport(0, 0, mWidth, mHeight);
|
||||
|
||||
lcGetActiveModel()->DrawBackground(mContext);
|
||||
lcModel* Model = lcGetActiveModel();
|
||||
if (Model)
|
||||
Model->DrawBackground(mContext);
|
||||
|
||||
lcVector3 Eye(0.0f, 0.0f, 1.0f);
|
||||
|
||||
|
|
|
@ -87,7 +87,8 @@ protected:
|
|||
|
||||
inline lcModel* lcGetActiveModel()
|
||||
{
|
||||
return lcGetActiveProject()->GetActiveModel();
|
||||
Project* Project = lcGetActiveProject();
|
||||
return Project ? Project->GetActiveModel() : NULL;
|
||||
}
|
||||
|
||||
#endif // _PROJECT_H_
|
||||
|
|
Loading…
Reference in a new issue