Fixed crash occurring when closing the world editor

This commit is contained in:
parax0 2016-08-31 02:53:48 -06:00
parent a7b381f301
commit 1f357b4250

View File

@ -1,6 +1,7 @@
#include "CEditorApplication.h"
#include "IEditor.h"
#include "CBasicViewport.h"
#include "Editor/WorldEditor/CWorldEditor.h"
#include <Common/AssertMacro.h>
#include <Common/CTimer.h>
@ -47,6 +48,9 @@ void CEditorApplication::OnEditorClose()
IEditor *pEditor = qobject_cast<IEditor*>(sender());
ASSERT(pEditor);
mEditorWindows.removeOne(pEditor);
delete pEditor;
if (qobject_cast<CWorldEditor*>(pEditor) == nullptr)
{
mEditorWindows.removeOne(pEditor);
delete pEditor;
}
}