summaryrefslogtreecommitdiff
path: root/src/gtkext
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-11-09 00:08:12 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-11-09 00:08:12 (GMT)
commitdc49b249f21c1c8582b9ca8debdd5fbdd15eadae (patch)
treeb5292d8fa7d94793623989e1c4d6074e8da02c4f /src/gtkext
parent4bafbf79e8143941d744c9c47e6fc9216fcec47a (diff)
Avoided to load the status bar twice and to crash in the worst case.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@605 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/gtkext')
-rw-r--r--src/gtkext/gtkextstatusbar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gtkext/gtkextstatusbar.c b/src/gtkext/gtkextstatusbar.c
index 74c23bd..8051d41 100644
--- a/src/gtkext/gtkextstatusbar.c
+++ b/src/gtkext/gtkextstatusbar.c
@@ -539,7 +539,9 @@ status_blob_info *init_progessive_status(GtkExtStatusBar *bar, const char *messa
result = (status_blob_info *)calloc(1, sizeof(status_blob_info));
- g_object_ref(G_OBJECT(bar));
+ if (bar != NULL)
+ g_object_ref(G_OBJECT(bar));
+
result->bar = bar;
result->id = gtk_extended_status_bar_push(bar, message, max > 0.0);
@@ -569,8 +571,7 @@ void fini_progessive_status(status_blob_info *info)
gtk_extended_status_bar_remove(info->bar, info->id);
if (info->bar != NULL)
-
- g_object_unref(G_OBJECT(info->bar));
+ g_object_unref(G_OBJECT(info->bar));
free(info);