Fixed WindowImplAndroid used after deleted.

This commit is contained in:
acsbendi 2019-04-25 14:16:04 +02:00 committed by Lukas Dürrenberger
parent f3a180bc09
commit 20c23f0007

View File

@ -84,6 +84,7 @@ WindowImplAndroid::WindowImplAndroid(VideoMode mode, const String& title, unsign
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
WindowImplAndroid::~WindowImplAndroid() WindowImplAndroid::~WindowImplAndroid()
{ {
WindowImplAndroid::singleInstance = NULL;
} }
@ -216,6 +217,8 @@ bool WindowImplAndroid::hasFocus() const
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void WindowImplAndroid::forwardEvent(const Event& event) void WindowImplAndroid::forwardEvent(const Event& event)
{ {
if (WindowImplAndroid::singleInstance != NULL)
{
ActivityStates* states = getActivity(NULL); ActivityStates* states = getActivity(NULL);
if (event.type == Event::GainedFocus) if (event.type == Event::GainedFocus)
@ -232,6 +235,7 @@ void WindowImplAndroid::forwardEvent(const Event& event)
} }
WindowImplAndroid::singleInstance->pushEvent(event); WindowImplAndroid::singleInstance->pushEvent(event);
}
} }