forked from phuang/ibus
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit 5a455b1 attempted to fix both GLib warnings around floating references and other presumed refcounting issues. However it missed 2 kinds of bugs: - The places that take an IBusText created from a static string were made to avoid freeing it afterwards, but the staticness refers to the string content, not the object itself. - The places that are documented to emit signals on floating object references used to do the following after signal emission: if (g_object_is_floating (object)) g_object_unref (object) And did possibly trigger GLib warnings were changed to: if (g_object_is_floating (object)) g_object_sink_ref (object); g_object_unref (object); Which fixes the GLib warning for floating references, but do unintendedly steal one reference away for non floating references. This commit is essentially a revert of commit 5a455b1, but addressing both things differently: - All label/tooltip/symbol IBusText properties in IBusProperty do now always sink the reference of the stored object. - All places documented as maybe using objects with a floating reference on signals changed to doing: if (g_object_is_floating (object)) { g_object_ref_sink (object); g_object_unref (object); } So the floating reference is owned and unreferenced without warnings, but already owned references are left unchanged. This addresses the possible GLib warnings, fixes the possible double unrefs happening on IBusText used in signals, and fixes the missing unrefs on IBusText objects created from static strings. BUG=#2393 BUG=#2387
- Loading branch information
Showing
2 changed files
with
38 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters