From 78a5bcfb660421f627449b3d9e252477e838e11b Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Thu, 14 Nov 2013 09:36:19 +1100 Subject: ScintillaGTK: Call superclass finalize() in ScintillaObject The ScintillaObject class does not chain up to its superclass in the finalize() function. This is a bug and must be done according to the GLib/GObject documentation. One effect of this is that the destroy notifiers supplied in e.g. g_object_set_data_full() are never run. Fixes Bug: #1549 ScintillaObject.finalize() does not chain up --- gtk/ScintillaGTK.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index fa108bac3..3a403ac7e 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -2355,6 +2355,10 @@ void ScintillaGTK::Destroy(GObject *object) { delete sciThis; scio->pscin = 0; + // Always chain up to the parent class + GType parent_type = g_type_parent(scintilla_get_type()); // GTK_TYPE_CONTAINER + GObjectClass *parent = G_OBJECT_CLASS(g_type_class_peek(parent_type)); + parent->finalize(object); } catch (...) { // Its dead so nowhere to save the status } -- cgit v1.2.3