summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJohn Ralls <jralls@ceridwen.us>2017-08-08 23:15:46 +0300
committerJohn Ralls <jralls@ceridwen.us>2017-08-08 23:21:55 +0300
commita2c4c54a2fa1e0a46ef426922c0ada5136c6e06b (patch)
tree8a72fe5cca3af46cc4b8a95024ea5b901c84ee9b /modules
parentc25f619033ae981a26be136fe754fca93ad5f7a3 (diff)
downloadgtk+-a2c4c54a2fa1e0a46ef426922c0ada5136c6e06b.tar.gz
Duplicate the TIC strings before NULLing the GObject data.
NULLing the data strings in GObject frees and invalidates the pointers returned by g_object_get_data so we need our own copy of the values.
Diffstat (limited to 'modules')
-rw-r--r--modules/input/imquartz.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/input/imquartz.c b/modules/input/imquartz.c
index 7e36378c31..c7bc5d2067 100644
--- a/modules/input/imquartz.c
+++ b/modules/input/imquartz.c
@@ -131,8 +131,8 @@ output_result (GtkIMContext *context,
gboolean retval = FALSE;
gchar *fixed_str, *marked_str;
- fixed_str = g_object_get_data (G_OBJECT (win), TIC_INSERT_TEXT);
- marked_str = g_object_get_data (G_OBJECT (win), TIC_MARKED_TEXT);
+ fixed_str = g_strdup (g_object_get_data (G_OBJECT (win), TIC_INSERT_TEXT));
+ marked_str = g_strdup (g_object_get_data (G_OBJECT (win), TIC_MARKED_TEXT));
if (fixed_str)
{
GTK_NOTE (MISC, g_print ("tic-insert-text: %s\n", fixed_str));
@@ -171,7 +171,8 @@ output_result (GtkIMContext *context,
if (qc->preedit_str && strlen (qc->preedit_str) > 0)
retval = TRUE;
}
-
+ g_free (fixed_str);
+ g_free (marked_str);
return retval;
}