diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-12-05 18:03:00 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-12-05 18:03:00 (GMT) |
commit | 2a7e284702a9cf3cfd060fe50e7ef96621633aa4 (patch) | |
tree | 15dc053ec6da4d1dc507ec1a76fb6f984e8bb723 /src/gtkext | |
parent | 5c51c967a7566f29218b3d8233248742ff4d5e4c (diff) |
Fixed a bug, memory leaks and cleaned the code.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@296 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext')
-rw-r--r-- | src/gtkext/gtkviewpanel.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gtkext/gtkviewpanel.c b/src/gtkext/gtkviewpanel.c index 3c9ef6b..a3bf747 100644 --- a/src/gtkext/gtkviewpanel.c +++ b/src/gtkext/gtkviewpanel.c @@ -125,14 +125,23 @@ static void gtk_view_panel_init(GtkViewPanel *panel) static void gtk_view_panel_set_scroll_adjustments(GtkViewPanel *panel, GtkAdjustment *hadjustment, GtkAdjustment *vadjustment) { + /* TODO : déconnecter les anciens ? */ + panel->hadjustment = hadjustment; panel->vadjustment = vadjustment; - g_signal_connect(hadjustment, "value_changed", - G_CALLBACK(gtk_view_panel_adj_value_changed), panel); + /** + * On vérifie que le support n'est pas en train de nous libérer, + * avant de se connecter... + */ + + if (hadjustment != NULL) + g_signal_connect(hadjustment, "value_changed", + G_CALLBACK(gtk_view_panel_adj_value_changed), panel); - g_signal_connect(vadjustment, "value_changed", - G_CALLBACK(gtk_view_panel_adj_value_changed), panel); + if (vadjustment != NULL) + g_signal_connect(vadjustment, "value_changed", + G_CALLBACK(gtk_view_panel_adj_value_changed), panel); } |