endpoint: ref the endpoint while unregistering

The core may be the last object holding a reference to the endpoint,
so the unregister call may destroy it.
This commit is contained in:
George Kiagiadakis 2019-06-11 12:49:11 +03:00
parent eabd2a49a4
commit 45dc9786f4

View file

@ -279,8 +279,10 @@ wp_endpoint_unregister (WpEndpoint * self)
g_info ("WpEndpoint:%p unregistering '%s' (%s)", self, priv->name,
priv->media_class);
g_object_ref (self);
wp_core_remove_global (priv->core, WP_GLOBAL_ENDPOINT, self);
priv->core = NULL;
g_object_unref (self);
}
}