GNOME Bugzilla – Bug 703533
textlayout: avoid double-free when adding preedit color
Last modified: 2013-07-09 04:22:03 UTC
I'm sorry, this is a fix for regression caused by my commit 7a9553cf. There was a double-free for original style->appearance.rgba when inserting coloured preedit text with input method. Downstream bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714625
Created attachment 248299 [details] [review] textlayout: avoid double-free when adding preedit color In add_preedit_attrs, don't free foreground/background colors already set in the underlying text attributes (style). They will be free'd by release_style.
Thank you for the patch. I've encountered this problem. I applied the patch and tested it as a user with gedit and anjuta. It fixed the bug, and the applications worked well. Thank you.
Review of attachment 248299 [details] [review]: ::: gtk/gtktextlayout.c @@ +1957,3 @@ + && appearance.rgba[1] != style->appearance.rgba[1]) + gdk_rgba_free (appearance.rgba[1]); + This is a bit ugly. I'd prefer to always copy the rgba entries when we copy the appearance struct, and then always free it at the end.
Created attachment 248359 [details] [review] textlayout: avoid double-free when adding preedit color In add_preedit_attrs, don't free foreground/background colors already set in the underlying text attributes (style). They will be free'd by release_style. -- Revised to copy the rgba entries. Thanks for the suggestion.
Review of attachment 248359 [details] [review]: thanks, looks good now
Attachment 248359 [details] pushed as 837a0d3 - textlayout: avoid double-free when adding preedit color