Fixed crash on startup if a toolbar was floating when the application closed the previous time.

This commit is contained in:
leo 2015-04-13 02:33:48 +00:00
parent 42151522fc
commit 0e0d352e6a
3 changed files with 7 additions and 4 deletions

View file

@ -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;

View file

@ -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);

View file

@ -87,7 +87,8 @@ protected:
inline lcModel* lcGetActiveModel()
{
return lcGetActiveProject()->GetActiveModel();
Project* Project = lcGetActiveProject();
return Project ? Project->GetActiveModel() : NULL;
}
#endif // _PROJECT_H_