summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2018-03-23 16:24:24 +0530
committerpranavk <pranavk@collabora.co.uk>2018-03-23 13:35:19 +0100
commited4df95f28d4081c8d244dc013fda53cee5f91b7 (patch)
tree250279afe400172d35bfee76a256241fbd07f472
parentb4c08ecf514c14ab339347639987d0db845b879d (diff)
lok: don't post events on disposed window
Change-Id: I7721380b1bb6e9ec21338a72523326d0cae6729e Reviewed-on: https://gerrit.libreoffice.org/51777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
-rw-r--r--include/vcl/ITiledRenderable.hxx3
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx2
2 files changed, 4 insertions, 1 deletions
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index b95ac6386829..e25cdd67506a 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -101,6 +101,9 @@ public:
static void LOKPostAsyncEvent(void* pEv, void*)
{
LOKAsyncEventData* pLOKEv = static_cast<LOKAsyncEventData*>(pEv);
+ if (pLOKEv->mpWindow->IsDisposed())
+ return;
+
switch (pLOKEv->mnEvent)
{
case VclEventId::WindowKeyInput:
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 4c442911c6eb..614050ba732f 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3487,7 +3487,7 @@ void SwXTextDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode)
SolarMutexGuard aGuard;
VclPtr<vcl::Window> pWindow = getDocWindow();
- if (!pWindow)
+ if (!pWindow || pWindow->IsDisposed())
return;
LOKAsyncEventData* pLOKEv = new LOKAsyncEventData;