plugin-manager: use dispose() as we're holding plugin objects

This commit is contained in:
Aleksander Morgado
2012-10-26 13:00:49 +02:00
parent 49c19bf83e
commit e5b4b4d0e5

View File

@@ -695,14 +695,17 @@ initable_init (GInitable *initable,
} }
static void static void
finalize (GObject *object) dispose (GObject *object)
{ {
MMPluginManager *self = MM_PLUGIN_MANAGER (object); MMPluginManager *self = MM_PLUGIN_MANAGER (object);
/* Cleanup list of plugins */ /* Cleanup list of plugins */
g_list_free_full (self->priv->plugins, (GDestroyNotify)g_object_unref); if (self->priv->plugins) {
g_list_free_full (self->priv->plugins, (GDestroyNotify)g_object_unref);
self->priv->plugins = NULL;
}
G_OBJECT_CLASS (mm_plugin_manager_parent_class)->finalize (object); G_OBJECT_CLASS (mm_plugin_manager_parent_class)->dispose (object);
} }
static void static void
@@ -719,5 +722,5 @@ mm_plugin_manager_class_init (MMPluginManagerClass *manager_class)
g_type_class_add_private (object_class, sizeof (MMPluginManagerPrivate)); g_type_class_add_private (object_class, sizeof (MMPluginManagerPrivate));
/* Virtual methods */ /* Virtual methods */
object_class->finalize = finalize; object_class->dispose = dispose;
} }