summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-08-08 22:37:28 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-08-08 22:37:28 (GMT)
commit89d41f2629b9d98069fa7c1db70821a14da57523 (patch)
treee573172068f9a8ee50eaf4028b9cd55f404a6717 /src/gtkext
parent8b17768e12ac797e06b5829ee4a4b9ab8da78954 (diff)
Fixed reference counting when switching panels.
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/gtkbufferdisplay.c2
-rw-r--r--src/gtkext/gtkdisplaypanel.c3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/gtkext/gtkbufferdisplay.c b/src/gtkext/gtkbufferdisplay.c
index fccea38..f41c4e3 100644
--- a/src/gtkext/gtkbufferdisplay.c
+++ b/src/gtkext/gtkbufferdisplay.c
@@ -205,7 +205,7 @@ static void gtk_buffer_display_init(GtkBufferDisplay *display)
static void gtk_buffer_display_dispose(GtkBufferDisplay *display)
{
- g_object_unref(G_OBJECT(display->view));
+ g_clear_object(&display->view);
G_OBJECT_CLASS(gtk_buffer_display_parent_class)->dispose(G_OBJECT(display));
diff --git a/src/gtkext/gtkdisplaypanel.c b/src/gtkext/gtkdisplaypanel.c
index 0c3a6b9..4b21d8c 100644
--- a/src/gtkext/gtkdisplaypanel.c
+++ b/src/gtkext/gtkdisplaypanel.c
@@ -231,8 +231,7 @@ static void gtk_display_panel_loaded_interface_init(GLoadedPanelInterface *iface
static void gtk_display_panel_dispose(GtkDisplayPanel *panel)
{
- if (panel->options != NULL)
- g_object_unref(G_OBJECT(panel->options));
+ g_clear_object(&panel->options);
G_OBJECT_CLASS(gtk_display_panel_parent_class)->dispose(G_OBJECT(panel));