changeset 2836:fbb17b57229a

fix possible segfault on cleanup
author Tomasz Mon <desowin@gmail.com>
date Mon, 14 Jul 2008 11:54:07 +0200
parents f1b6f1b2cdb3
children bdc4fbf878ec
files src/skins/ui_skinned_textbox.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/skins/ui_skinned_textbox.c	Mon Jul 14 03:35:13 2008 +0300
+++ b/src/skins/ui_skinned_textbox.c	Mon Jul 14 11:54:07 2008 +0200
@@ -185,11 +185,18 @@
 
 static void ui_skinned_textbox_destroy(GtkObject *object) {
     UiSkinnedTextbox *textbox;
+    UiSkinnedTextboxPrivate *priv;
 
     g_return_if_fail (object != NULL);
     g_return_if_fail (UI_SKINNED_IS_TEXTBOX (object));
 
     textbox = UI_SKINNED_TEXTBOX (object);
+    priv = UI_SKINNED_TEXTBOX_GET_PRIVATE(object);
+
+    if (priv->scroll_timeout) {
+        g_source_remove(priv->scroll_timeout);
+        priv->scroll_timeout = 0;
+    }
 
     if (GTK_OBJECT_CLASS (parent_class)->destroy)
         (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);