Merge lp:~linaro-graphics-wg/unity/ubus-gtypeinit into lp:unity
Status: | Merged |
---|---|
Approved by: | Jay Taoko |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2140 |
Proposed branch: | lp:~linaro-graphics-wg/unity/ubus-gtypeinit |
Merge into: | lp:unity |
Diff against target: |
13 lines (+3/-0) 1 file modified
plugins/unityshell/src/ubus-server.cpp (+3/-0) |
To merge this branch: | bzr merge lp:~linaro-graphics-wg/unity/ubus-gtypeinit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Approve | ||
Jay Taoko (community) | Approve | ||
Review via email: mp+97849@code.launchpad.net |
Commit message
ubus: Ensure the GType system has been initialized before using any GTypes.
The unity plugin doesn't explicitly call g_type_init(), although it uses a
GObject for UBusServer. This currently works because the ccp plugin, which
gets loaded before the unity plugin, calls g_type_init(), but this is fragile.
If ccp is not used, g_type_init() is not called by the time UBusServer gets
initialized, leading to a crash. This patch ensures that the GType system
has been initialized before using UBusServer (it is safe to call g_type_init()
multiple times).
Description of the change
ubus: Ensure the GType system has been initialized before using any GTypes.
The unity plugin doesn't explicitly call g_type_init(), although it uses a
GObject for UBusServer. This currently works because the ccp plugin, which
gets loaded before the unity plugin, calls g_type_init(), but this is fragile.
If ccp is not used, g_type_init() is not called by the time UBusServer gets
initialized, leading to a crash. This patch ensures that the GType system
has been initialized before using UBusServer (it is safe to call g_type_init()
multiple times).
+1