[gnome-builder/gnome-builder-3-26] prefs: release extensions on destroy event
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-26] prefs: release extensions on destroy event
- Date: Mon, 25 Sep 2017 06:59:33 +0000 (UTC)
commit c20976f0bfb33fa79b187da65a994a4b8a712682
Author: Christian Hergert <chergert redhat com>
Date: Sun Sep 24 23:58:12 2017 -0700
prefs: release extensions on destroy event
These were getting leaked apparently.
libide/preferences/ide-preferences-perspective.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/libide/preferences/ide-preferences-perspective.c
b/libide/preferences/ide-preferences-perspective.c
index f4f3873..e3a43a2 100644
--- a/libide/preferences/ide-preferences-perspective.c
+++ b/libide/preferences/ide-preferences-perspective.c
@@ -72,6 +72,16 @@ ide_preferences_perspective_extension_removed (PeasExtensionSet *set,
}
static void
+ide_preferences_perspective_destroy (GtkWidget *widget)
+{
+ IdePreferencesPerspective *self = (IdePreferencesPerspective *)widget;
+
+ g_clear_object (&self->extensions);
+
+ GTK_WIDGET_CLASS (ide_preferences_perspective_parent_class)->destroy (widget);
+}
+
+static void
ide_preferences_perspective_constructed (GObject *object)
{
IdePreferencesPerspective *self = (IdePreferencesPerspective *)object;
@@ -103,8 +113,11 @@ static void
ide_preferences_perspective_class_init (IdePreferencesPerspectiveClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->constructed = ide_preferences_perspective_constructed;
+
+ widget_class->destroy = ide_preferences_perspective_destroy;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]