From 417b0dff4c5bcb0e4e9397eb4be51bf4bbeeefaf Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Fri, 23 Jun 2023 14:12:27 +0300 Subject: [PATCH] m-std-event-source: don't push events during the core dispose sequence --- modules/module-standard-event-source.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/module-standard-event-source.c b/modules/module-standard-event-source.c index 7e21e601..11007fd5 100644 --- a/modules/module-standard-event-source.c +++ b/modules/module-standard-event-source.c @@ -250,7 +250,12 @@ wp_standard_event_source_push_event (WpStandardEventSource *self, { g_autoptr (WpCore) core = wp_object_get_core (WP_OBJECT (self)); - g_return_if_fail (core); + + /* this can happen during the core dispose sequence; the weak ref to the + core is invalidated before the registered objects are destroyed */ + if (!core) + return; + g_autoptr (WpEventDispatcher) dispatcher = wp_event_dispatcher_get_instance (core); g_return_if_fail (dispatcher);