m-std-event-source: don't crash in disable() if the core is not available
When the core is shutting down, the weak reference to it is cleared before we have a change to use it, but it's ok because everything is getting destroyed at this point, including the hook that we want to unregister.
This commit is contained in:

committed by
Julian Bouzas

parent
ce44d9a5ef
commit
dbca5783d0
@@ -364,9 +364,8 @@ wp_standard_event_source_disable (WpPlugin * plugin)
|
|||||||
{
|
{
|
||||||
WpStandardEventSource * self = WP_STANDARD_EVENT_SOURCE (plugin);
|
WpStandardEventSource * self = WP_STANDARD_EVENT_SOURCE (plugin);
|
||||||
g_autoptr (WpCore) core = wp_object_get_core (WP_OBJECT (plugin));
|
g_autoptr (WpCore) core = wp_object_get_core (WP_OBJECT (plugin));
|
||||||
g_return_if_fail (core);
|
g_autoptr (WpEventDispatcher) dispatcher = core ?
|
||||||
g_autoptr (WpEventDispatcher) dispatcher =
|
wp_event_dispatcher_get_instance (core) : NULL;
|
||||||
wp_event_dispatcher_get_instance (core);
|
|
||||||
|
|
||||||
for (gint i = 0; i < N_OBJECT_TYPES; i++)
|
for (gint i = 0; i < N_OBJECT_TYPES; i++)
|
||||||
g_clear_object (&self->oms[i]);
|
g_clear_object (&self->oms[i]);
|
||||||
|
Reference in New Issue
Block a user