summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2012-04-02 21:48:46 +0300
committerTor Lillqvist <tlillqvist@suse.com>2012-04-02 21:58:23 +0300
commit337a154b4f90ce90da30f81720a9debfb19e6d43 (patch)
treeb11c5fa1e9e46f54e18edd657f27c0ea22eeb47a /vcl
parent01550b2968f2e95deacaff544f8a4c2e9f5196ea (diff)
Don't crash in a non-NativeActivity app where mpApp is NULL
Diffstat (limited to 'vcl')
-rw-r--r--vcl/android/androidinst.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index af78a22d5841..52ebe53b4af8 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -378,14 +378,13 @@ static const char *app_cmd_name(int cmd)
void AndroidSalInstance::GetWorkArea( Rectangle& rRect )
{
- ANativeWindow *pWindow = mpApp->window;
- if (!pWindow)
+ if (!mpApp || !mpApp->window)
rRect = Rectangle( Point( 0, 0 ),
Size( 800, 600 ) );
else
rRect = Rectangle( Point( 0, 0 ),
- Size( ANativeWindow_getWidth( pWindow ),
- ANativeWindow_getHeight( pWindow ) ) );
+ Size( ANativeWindow_getWidth( mpApp->window ),
+ ANativeWindow_getHeight( mpApp->window ) ) );
}
void AndroidSalInstance::onAppCmd (struct android_app* app, int32_t cmd)
@@ -632,7 +631,7 @@ void AndroidSalInstance::DoReleaseYield (int nTimeoutMS)
pSource->process(mpApp, pSource);
}
- if (mbQueueReDraw && mpApp->window)
+ if (mbQueueReDraw && mpApp && mpApp->window)
AndroidSalInstance::getInstance()->RedrawWindows (mpApp->window);
}