[uim-commit] r1498 - trunk/gtk
tkng at freedesktop.org
tkng at freedesktop.org
Wed Sep 14 20:25:39 PDT 2005
Author: tkng
Date: 2005-09-14 20:25:36 -0700 (Wed, 14 Sep 2005)
New Revision: 1498
Modified:
trunk/gtk/caret-state-indicator.c
trunk/gtk/gtk-im-uim.c
Log:
This commit aims to fix segv bug. This bug appeared when caret_state_indicator_timeout was called
after im_uim_finalize.
* gtk/gtk-im-uim.c
-(im_uim_finalize): Remove timeout function of caret-state-indicator.
* gtk/caret-state-indicator.c
-(caret_state_indicator_set_timeout): Store tag of g_timeout_add to caret-state-indicator.
Modified: trunk/gtk/caret-state-indicator.c
===================================================================
--- trunk/gtk/caret-state-indicator.c 2005-09-14 22:20:37 UTC (rev 1497)
+++ trunk/gtk/caret-state-indicator.c 2005-09-15 03:25:36 UTC (rev 1498)
@@ -144,8 +144,8 @@
caret_state_indicator_set_timeout(GtkWidget *window, gint timeout)
{
gint current_time = get_current_time();
-
- g_timeout_add(timeout, caret_state_indicator_timeout, (gpointer)window);
+ guint tag = g_timeout_add(timeout, caret_state_indicator_timeout, (gpointer)window);
+ g_object_set_data(G_OBJECT(window), "timeout-tag", GINT_TO_POINTER(tag));
g_object_set_data(G_OBJECT(window), "timeout", GINT_TO_POINTER(timeout));
g_object_set_data(G_OBJECT(window), "called_time", GINT_TO_POINTER(current_time));
/* "called_time" stores the time of last calling of this function */
Modified: trunk/gtk/gtk-im-uim.c
===================================================================
--- trunk/gtk/gtk-im-uim.c 2005-09-14 22:20:37 UTC (rev 1497)
+++ trunk/gtk/gtk-im-uim.c 2005-09-15 03:25:36 UTC (rev 1498)
@@ -666,6 +666,8 @@
uic->cwin = NULL;
}
if (uic->caret_state_indicator) {
+ guint tag = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(uic->caret_state_indicator), "timeout-tag"));
+ g_source_remove(tag);
gtk_widget_destroy(uic->caret_state_indicator);
uic->caret_state_indicator = NULL;
}
More information about the uim-commit
mailing list