From aa3d5719b78d592879615a91c1d5332fc4882054 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Mon, 18 Mar 2002 17:49:51 +0000 Subject: [PATCH] Patch from Yao Zhang fixing reference count leak. Mon Mar 18 11:55:03 2002 Owen Taylor * gtk/gtkimmulticontext.c (gtk_im_multicontext_get_slave): Patch from Yao Zhang fixing reference count leak. * gtk/gtkentry.c (gtk_entry_key_release): if (entry->editable), not if (!entry->editable). --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ ChangeLog.pre-2-2 | 8 ++++++++ ChangeLog.pre-2-4 | 8 ++++++++ ChangeLog.pre-2-6 | 8 ++++++++ ChangeLog.pre-2-8 | 8 ++++++++ gtk/gtkentry.c | 2 +- gtk/gtkimmulticontext.c | 7 ++++++- 8 files changed, 55 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 532c5caf90..823809230e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Mar 18 11:55:03 2002 Owen Taylor + + * gtk/gtkimmulticontext.c (gtk_im_multicontext_get_slave): + Patch from Yao Zhang fixing reference count leak. + + * gtk/gtkentry.c (gtk_entry_key_release): if (entry->editable), + not if (!entry->editable). + Mon Mar 18 11:09:17 2002 Owen Taylor * gdk/x11/gdkwindow-x11.c (gdk_window_set_override_redirect): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 532c5caf90..823809230e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +Mon Mar 18 11:55:03 2002 Owen Taylor + + * gtk/gtkimmulticontext.c (gtk_im_multicontext_get_slave): + Patch from Yao Zhang fixing reference count leak. + + * gtk/gtkentry.c (gtk_entry_key_release): if (entry->editable), + not if (!entry->editable). + Mon Mar 18 11:09:17 2002 Owen Taylor * gdk/x11/gdkwindow-x11.c (gdk_window_set_override_redirect): diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 532c5caf90..823809230e 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,11 @@ +Mon Mar 18 11:55:03 2002 Owen Taylor + + * gtk/gtkimmulticontext.c (gtk_im_multicontext_get_slave): + Patch from Yao Zhang fixing reference count leak. + + * gtk/gtkentry.c (gtk_entry_key_release): if (entry->editable), + not if (!entry->editable). + Mon Mar 18 11:09:17 2002 Owen Taylor * gdk/x11/gdkwindow-x11.c (gdk_window_set_override_redirect): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 532c5caf90..823809230e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,11 @@ +Mon Mar 18 11:55:03 2002 Owen Taylor + + * gtk/gtkimmulticontext.c (gtk_im_multicontext_get_slave): + Patch from Yao Zhang fixing reference count leak. + + * gtk/gtkentry.c (gtk_entry_key_release): if (entry->editable), + not if (!entry->editable). + Mon Mar 18 11:09:17 2002 Owen Taylor * gdk/x11/gdkwindow-x11.c (gdk_window_set_override_redirect): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 532c5caf90..823809230e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,11 @@ +Mon Mar 18 11:55:03 2002 Owen Taylor + + * gtk/gtkimmulticontext.c (gtk_im_multicontext_get_slave): + Patch from Yao Zhang fixing reference count leak. + + * gtk/gtkentry.c (gtk_entry_key_release): if (entry->editable), + not if (!entry->editable). + Mon Mar 18 11:09:17 2002 Owen Taylor * gdk/x11/gdkwindow-x11.c (gdk_window_set_override_redirect): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 532c5caf90..823809230e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,11 @@ +Mon Mar 18 11:55:03 2002 Owen Taylor + + * gtk/gtkimmulticontext.c (gtk_im_multicontext_get_slave): + Patch from Yao Zhang fixing reference count leak. + + * gtk/gtkentry.c (gtk_entry_key_release): if (entry->editable), + not if (!entry->editable). + Mon Mar 18 11:09:17 2002 Owen Taylor * gdk/x11/gdkwindow-x11.c (gdk_window_set_override_redirect): diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index fd5733a908..00d67cbdd9 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -1539,7 +1539,7 @@ gtk_entry_key_release (GtkWidget *widget, { GtkEntry *entry = GTK_ENTRY (widget); - if (!entry->editable) + if (entry->editable) { if (gtk_im_context_filter_keypress (entry->im_context, event)) { diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c index 3abb72f24d..446a51f78a 100644 --- a/gtk/gtkimmulticontext.c +++ b/gtk/gtkimmulticontext.c @@ -217,6 +217,8 @@ gtk_im_multicontext_get_slave (GtkIMMulticontext *multicontext) { if (!multicontext->slave) { + GtkIMContext *slave; + if (!global_context_id) { const char *locale; @@ -229,7 +231,10 @@ gtk_im_multicontext_get_slave (GtkIMMulticontext *multicontext) global_context_id = _gtk_im_module_get_default_context_id (locale); } - gtk_im_multicontext_set_slave (multicontext, _gtk_im_module_create (global_context_id), FALSE); + slave = _gtk_im_module_create (global_context_id); + gtk_im_multicontext_set_slave (multicontext, slave, FALSE); + g_object_unref (slave); + multicontext->context_id = global_context_id; }