[Libreoffice-commits] core.git: libreofficekit/source
Caolán McNamara
caolanm at redhat.com
Tue May 9 07:30:37 UTC 2017
libreofficekit/source/gtk/lokdocview.cxx | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
New commits:
commit c45660df336a640f0f9d4290b881548d25c9db9d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri May 5 14:34:51 2017 +0100
rhbz#1444437 gnome-documents finalize may not occur immediately
when LOK Widget is destroyed, it may instead happen during GC of javascript,
like in the in gnome-documents case, but "destroy" will be called promptly. So
close documents and office in destroy, not finalize
Change-Id: I1dd7b828839894cb2d87f5c087194fe458ca22f0
Reviewed-on: https://gerrit.libreoffice.org/37398
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 1effc335aed4..65c5a64111f6 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -2595,9 +2595,12 @@ static gboolean lok_doc_view_draw (GtkWidget* pWidget, cairo_t* pCairo)
return FALSE;
}
-static void lok_doc_view_finalize (GObject* object)
+//rhbz#1444437 finalize may not occur immediately when this widget is destroyed
+//it may happen during GC of javascript, e.g. in gnome-documents but "destroy"
+//will be called promptly, so close documents in destroy, not finalize
+static void lok_doc_view_destroy (GtkWidget* widget)
{
- LOKDocView* pDocView = LOK_DOC_VIEW (object);
+ LOKDocView* pDocView = LOK_DOC_VIEW (widget);
LOKDocViewPrivate& priv = getPrivate(pDocView);
// Ignore notifications sent to this view on shutdown.
@@ -2620,6 +2623,15 @@ static void lok_doc_view_finalize (GObject* object)
if (priv->m_pOffice)
priv->m_pOffice->pClass->destroy (priv->m_pOffice);
}
+
+ GTK_WIDGET_CLASS (lok_doc_view_parent_class)->destroy (widget);
+}
+
+static void lok_doc_view_finalize (GObject* object)
+{
+ LOKDocView* pDocView = LOK_DOC_VIEW (object);
+ LOKDocViewPrivate& priv = getPrivate(pDocView);
+
delete priv.m_pImpl;
priv.m_pImpl = nullptr;
@@ -2670,6 +2682,7 @@ static void lok_doc_view_class_init (LOKDocViewClass* pClass)
pWidgetClass->key_press_event = signalKey;
pWidgetClass->key_release_event = signalKey;
pWidgetClass->motion_notify_event = lok_doc_view_signal_motion;
+ pWidgetClass->destroy = lok_doc_view_destroy;
/**
* LOKDocView:lopath:
More information about the Libreoffice-commits
mailing list