mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
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.
This commit is contained in:
parent
8a22e3598d
commit
d09bd2e2d3
@ -131,8 +131,8 @@ output_result (GtkIMContext *context,
|
|||||||
gboolean retval = FALSE;
|
gboolean retval = FALSE;
|
||||||
gchar *fixed_str, *marked_str;
|
gchar *fixed_str, *marked_str;
|
||||||
|
|
||||||
fixed_str = g_object_get_data (G_OBJECT (win), TIC_INSERT_TEXT);
|
fixed_str = g_strdup (g_object_get_data (G_OBJECT (win), TIC_INSERT_TEXT));
|
||||||
marked_str = g_object_get_data (G_OBJECT (win), TIC_MARKED_TEXT);
|
marked_str = g_strdup (g_object_get_data (G_OBJECT (win), TIC_MARKED_TEXT));
|
||||||
if (fixed_str)
|
if (fixed_str)
|
||||||
{
|
{
|
||||||
GTK_NOTE (MISC, g_print ("tic-insert-text: %s\n", 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)
|
if (qc->preedit_str && strlen (qc->preedit_str) > 0)
|
||||||
retval = TRUE;
|
retval = TRUE;
|
||||||
}
|
}
|
||||||
|
g_free (fixed_str);
|
||||||
|
g_free (marked_str);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user