summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/menus/view.c14
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));
}