Fixed WindowImplAndroid used after deleted.
This commit is contained in:
parent
f3a180bc09
commit
20c23f0007
@ -84,6 +84,7 @@ WindowImplAndroid::WindowImplAndroid(VideoMode mode, const String& title, unsign
|
||||
////////////////////////////////////////////////////////////
|
||||
WindowImplAndroid::~WindowImplAndroid()
|
||||
{
|
||||
WindowImplAndroid::singleInstance = NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -216,22 +217,25 @@ bool WindowImplAndroid::hasFocus() const
|
||||
////////////////////////////////////////////////////////////
|
||||
void WindowImplAndroid::forwardEvent(const Event& event)
|
||||
{
|
||||
ActivityStates* states = getActivity(NULL);
|
||||
|
||||
if (event.type == Event::GainedFocus)
|
||||
if (WindowImplAndroid::singleInstance != NULL)
|
||||
{
|
||||
WindowImplAndroid::singleInstance->m_size.x = ANativeWindow_getWidth(states->window);
|
||||
WindowImplAndroid::singleInstance->m_size.y = ANativeWindow_getHeight(states->window);
|
||||
WindowImplAndroid::singleInstance->m_windowBeingCreated = true;
|
||||
WindowImplAndroid::singleInstance->m_hasFocus = true;
|
||||
}
|
||||
else if (event.type == Event::LostFocus)
|
||||
{
|
||||
WindowImplAndroid::singleInstance->m_windowBeingDestroyed = true;
|
||||
WindowImplAndroid::singleInstance->m_hasFocus = false;
|
||||
}
|
||||
ActivityStates* states = getActivity(NULL);
|
||||
|
||||
WindowImplAndroid::singleInstance->pushEvent(event);
|
||||
if (event.type == Event::GainedFocus)
|
||||
{
|
||||
WindowImplAndroid::singleInstance->m_size.x = ANativeWindow_getWidth(states->window);
|
||||
WindowImplAndroid::singleInstance->m_size.y = ANativeWindow_getHeight(states->window);
|
||||
WindowImplAndroid::singleInstance->m_windowBeingCreated = true;
|
||||
WindowImplAndroid::singleInstance->m_hasFocus = true;
|
||||
}
|
||||
else if (event.type == Event::LostFocus)
|
||||
{
|
||||
WindowImplAndroid::singleInstance->m_windowBeingDestroyed = true;
|
||||
WindowImplAndroid::singleInstance->m_hasFocus = false;
|
||||
}
|
||||
|
||||
WindowImplAndroid::singleInstance->pushEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user