diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-08-08 22:37:28 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-08-08 22:37:28 (GMT) |
commit | 89d41f2629b9d98069fa7c1db70821a14da57523 (patch) | |
tree | e573172068f9a8ee50eaf4028b9cd55f404a6717 /src/gui | |
parent | 8b17768e12ac797e06b5829ee4a4b9ab8da78954 (diff) |
Fixed reference counting when switching panels.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/menus/view.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c index 6f113e2..4dca039 100644 --- a/src/gui/menus/view.c +++ b/src/gui/menus/view.c @@ -751,8 +751,8 @@ static void change_current_view_support(unsigned int wanted) GtkDockStation *station; /* Base du remplacement */ GLoadedContent *content; /* Contenu représenté */ GtkWidget *support; /* Nouvel afficheur généraliste*/ - GLineCursor *cursor; /* Position à transmettre */ GLoadedPanel *new; /* Panneau encapsulé */ + GLineCursor *cursor; /* Position à transmettre */ panel = get_current_view(); @@ -764,20 +764,22 @@ static void change_current_view_support(unsigned int wanted) g_object_unref(G_OBJECT(content)); - cursor = g_loaded_panel_get_cursor(panel); - gtk_dock_panel_change_active_widget(station, support); new = G_LOADED_PANEL(get_loaded_panel_from_built_view(support)); - g_loaded_panel_set_cursor(new, cursor); + cursor = g_loaded_panel_get_cursor(panel); + + if (cursor != NULL) + { + g_loaded_panel_set_cursor(new, cursor); + g_object_unref(G_OBJECT(cursor)); + } change_editor_items_current_view(new); g_object_unref(G_OBJECT(new)); - g_object_unref(G_OBJECT(cursor)); - g_object_unref(G_OBJECT(panel)); } |