[totem] browser-plugin: Fix possible warnings when destroyed
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] browser-plugin: Fix possible warnings when destroyed
- Date: Fri, 21 Jan 2011 11:26:21 +0000 (UTC)
commit dec323d0a3cd23274f05ba8b589d12a03bfb8ecf
Author: Bastien Nocera <hadess hadess net>
Date: Fri Jan 21 11:23:34 2011 +0000
browser-plugin: Fix possible warnings when destroyed
Each time the widget was left, we would add a new timeout, without
removing the old one. This could cause warnings once the widget
was destroyed.
https://bugzilla.gnome.org/show_bug.cgi?id=640109
browser-plugin/totem-glow-button.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/browser-plugin/totem-glow-button.c b/browser-plugin/totem-glow-button.c
index ae1cea2..befa49c 100644
--- a/browser-plugin/totem-glow-button.c
+++ b/browser-plugin/totem-glow-button.c
@@ -216,6 +216,7 @@ totem_glow_button_enter (GtkButton *buttonw)
button->pointer_entered = TRUE;
button->anim_finished = FALSE;
button->glow_start_time = G_MINDOUBLE;
+ totem_glow_button_set_timeout (button, FALSE);
}
static void
@@ -281,10 +282,14 @@ totem_glow_button_new (void)
return g_object_new (TOTEM_TYPE_GLOW_BUTTON, NULL);
}
+/* We can only add a timeout once, we assert that, though
+ * calling it multiple times to disable the animation is fine */
static void
totem_glow_button_set_timeout (TotemGlowButton *button, gboolean set_timeout)
{
if (set_timeout != FALSE) {
+ g_assert (button->button_glow == 0);
+
button->glow_start_time = 0.0;
/* The animation doesn't speed up or slow down based on the
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]