diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-06-16 15:30:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-06-16 16:42:42 +0200 |
commit | 805adaae918d91cbde510aef6d7422cb345c41d4 (patch) | |
tree | 19c5d44a13091c1013afdc13582dbc3980576ef3 /libreofficekit | |
parent | b3947785202ac263671113d6c9fd57d3ce6208d5 (diff) |
Resolves: rhbz#1454693 segv if tiled rendering is interrupted
Change-Id: I1131f246c43806adb8a83f6eeafca2b734851a0e
Reviewed-on: https://gerrit.libreoffice.org/38888
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index ceda8160c9dd..0a81d3679b69 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -1148,6 +1148,14 @@ callback (gpointer pData) LOKDocView* pDocView = LOK_DOC_VIEW (pCallback->m_pDocView); LOKDocViewPrivate& priv = getPrivate(pDocView); + //callback registered before the widget was destroyed. + //Use existance of lokThreadPool as flag it was torn down + if (!priv->lokThreadPool) + { + delete pCallback; + return G_SOURCE_REMOVE; + } + switch (pCallback->m_nType) { case LOK_CALLBACK_INVALIDATE_TILES: @@ -2627,6 +2635,13 @@ static void lok_doc_view_destroy (GtkWidget* widget) priv->m_pDocument->pClass->setView(priv->m_pDocument, priv->m_nViewId); priv->m_pDocument->pClass->registerCallback(priv->m_pDocument, nullptr, nullptr); } + + if (priv->lokThreadPool) + { + g_thread_pool_free(priv->lokThreadPool, true, true); + priv->lokThreadPool = nullptr; + } + aGuard.unlock(); if (priv->m_pDocument) |