Exemplo n.º 1
0
static void
pragha_application_dispose (GObject *object)
{
	PraghaApplication *pragha = PRAGHA_APPLICATION (object);

	CDEBUG(DBG_INFO, "Cleaning up");

#ifdef HAVE_LIBPEAS
	if (pragha->plugins_engine) {
		g_object_unref (pragha->plugins_engine);
		pragha->plugins_engine = NULL;
	}
#endif
	if (pragha->setting_dialog) {
		pragha_preferences_dialog_free (pragha->setting_dialog);
		pragha->setting_dialog = NULL;
	}
	if (pragha->backend) {
		g_object_unref (pragha->backend);
		pragha->backend = NULL;
	}
	if (pragha->art_cache) {
		g_object_unref (pragha->art_cache);
		pragha->art_cache = NULL;
	}
	if (pragha->enum_map) {
		g_object_unref (pragha->enum_map);
		pragha->enum_map = NULL;
	}
	if (pragha->scanner) {
		pragha_scanner_free (pragha->scanner);
		pragha->scanner = NULL;
	}
	if (pragha->menu_ui_manager) {
		g_object_unref (pragha->menu_ui_manager);
		pragha->menu_ui_manager = NULL;
	}
	if (pragha->menu_ui) {
		g_object_unref (pragha->menu_ui);
		pragha->menu_ui = NULL;
	}

	/* Save Preferences and database. */

	if (pragha->preferences) {
		g_object_unref (pragha->preferences);
		pragha->preferences = NULL;
	}
	if (pragha->provider) {
		g_object_unref (pragha->provider);
		pragha->provider = NULL;
	}
	if (pragha->cdbase) {
		g_object_unref (pragha->cdbase);
		pragha->cdbase = NULL;
	}

	G_OBJECT_CLASS (pragha_application_parent_class)->dispose (object);
}
Exemplo n.º 2
0
static void
pragha_application_dispose (GObject *object)
{
	PraghaApplication *pragha = PRAGHA_APPLICATION (object);

	CDEBUG(DBG_INFO, "Cleaning up");

	if (pragha->sidebar2_binding) {
		g_object_unref (pragha->sidebar2_binding);
		pragha->sidebar2_binding = NULL;
	}
#ifdef HAVE_LIBPEAS
	if (pragha->peas_engine) {
		pragha_plugins_save_activated (pragha);

		peas_engine_garbage_collect (pragha->peas_engine);

		g_object_unref (pragha->peas_engine);
		pragha->peas_engine = NULL;
	}
	if (pragha->peas_exten_set) {
		g_object_unref (pragha->peas_exten_set);
		pragha->peas_exten_set = NULL;
	}
#endif
	if (pragha->setting_dialog) {
		pragha_preferences_dialog_free (pragha->setting_dialog);
		pragha->setting_dialog = NULL;
	}
	if (pragha->backend) {
		pragha_playback_stop (pragha);
		g_object_unref (pragha->backend);
		pragha->backend = NULL;
	}
	if (pragha->art_cache) {
		g_object_unref (pragha->art_cache);
		pragha->art_cache = NULL;
	}
	if (pragha->enum_map) {
		g_object_unref (pragha->enum_map);
		pragha->enum_map = NULL;
	}
	if (pragha->mainwindow) {
		pragha_window_free (pragha);
		/* Explicit destroy mainwindow to finalize lifecycle of childrens */
		gtk_widget_destroy (pragha->mainwindow);
		pragha->mainwindow = NULL;
	}
	if (pragha->scanner) {
		pragha_scanner_free (pragha->scanner);
		pragha->scanner = NULL;
	}

	if (pragha->pixbuf_app) {
		g_object_unref (pragha->pixbuf_app);
		pragha->pixbuf_app = NULL;
	}

	if (pragha->menu_ui_manager) {
		g_object_unref (pragha->menu_ui_manager);
		pragha->menu_ui_manager = NULL;
	}

	/* Save Preferences and database. */

	if (pragha->preferences) {
		g_object_unref (pragha->preferences);
		pragha->preferences = NULL;
	}
	if (pragha->cdbase) {
		g_object_unref (pragha->cdbase);
		pragha->cdbase = NULL;
	}

	G_OBJECT_CLASS (pragha_application_parent_class)->dispose (object);
}