From 85d993386ad6694d9db602973ef17e75e17c1fd1 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Fri, 31 Aug 2012 01:50:25 +0200 Subject: [PATCH] st-im-text: Simplify dispose There's no need to disconnect signal handlers on a private object that we are destroying. --- src/st/st-im-text.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/st/st-im-text.c b/src/st/st-im-text.c index d5e287a42..ddd95b84d 100644 --- a/src/st/st-im-text.c +++ b/src/st/st-im-text.c @@ -77,13 +77,6 @@ struct _StIMTextPrivate guint need_im_reset : 1; }; -static void st_im_text_commit_cb (GtkIMContext *context, - const gchar *str, - StIMText *imtext); - -static void st_im_text_preedit_changed_cb (GtkIMContext *context, - StIMText *imtext); - G_DEFINE_TYPE (StIMText, st_im_text, CLUTTER_TYPE_TEXT) static void @@ -91,18 +84,7 @@ st_im_text_dispose (GObject *object) { StIMTextPrivate *priv = ST_IM_TEXT (object)->priv; - if (priv->im_context != NULL) - { - g_signal_handlers_disconnect_by_func (priv->im_context, - (void *) st_im_text_commit_cb, - object); - g_signal_handlers_disconnect_by_func (priv->im_context, - (void *) st_im_text_preedit_changed_cb, - object); - - g_object_unref (priv->im_context); - priv->im_context = NULL; - } + g_clear_object (&priv->im_context); G_OBJECT_CLASS (st_im_text_parent_class)->dispose (object); }