[gnome-bluetooth] Fix possible crasher when still searching but widget is destroyed
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-bluetooth] Fix possible crasher when still searching but widget is destroyed
- Date: Wed, 15 Jul 2009 09:45:20 +0000 (UTC)
commit 63b38dd0cf9622c89e0686a5bbcbf6f27b365db3
Author: Bastien Nocera <hadess hadess net>
Date: Mon Jul 13 20:28:16 2009 +0100
Fix possible crasher when still searching but widget is destroyed
The timeout needs to be cancelled when the device is destroyed.
lib/bling-spinner.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/lib/bling-spinner.c b/lib/bling-spinner.c
index 34a41c1..4bcffe5 100644
--- a/lib/bling-spinner.c
+++ b/lib/bling-spinner.c
@@ -60,6 +60,7 @@ struct _BlingSpinnerPrivate
/* FORWARDS */
static void bling_spinner_class_init(BlingSpinnerClass *klass);
static void bling_spinner_init(BlingSpinner *spinner);
+static void bling_spinner_finalize (GObject *gobject);
static void bling_spinner_set_property(GObject *gobject, guint prop_id, const GValue *value, GParamSpec *pspec);
static gboolean bling_spinner_expose(GtkWidget *widget, GdkEventExpose *event);
static void bling_spinner_screen_changed (GtkWidget* widget, GdkScreen* old_screen);
@@ -134,6 +135,7 @@ bling_spinner_class_init(BlingSpinnerClass *klass)
gobject_class = G_OBJECT_CLASS(klass);
g_type_class_add_private (gobject_class, sizeof (BlingSpinnerPrivate));
gobject_class->set_property = bling_spinner_set_property;
+ gobject_class->finalize = bling_spinner_finalize;
widget_class = GTK_WIDGET_CLASS(klass);
widget_class->expose_event = bling_spinner_expose;
@@ -257,6 +259,21 @@ bling_spinner_set_property(GObject *gobject, guint prop_id,
}
}
+static void
+bling_spinner_finalize (GObject *gobject)
+{
+ BlingSpinner *spinner;
+ BlingSpinnerPrivate *priv;
+
+ spinner = BLING_SPINNER(gobject);
+ priv = BLING_SPINNER_GET_PRIVATE (spinner);
+
+ if (priv->timeout != 0) {
+ g_source_remove (priv->timeout);
+ priv->timeout = 0;
+ }
+}
+
/**
* bling_spinner_new
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]