diff options
author | Philip Withnall <pwithnall@svn.gnome.org> | 2008-02-05 07:06:53 +0000 |
---|---|---|
committer | Philip Withnall <pwithnall@src.gnome.org> | 2008-02-05 07:06:53 +0000 |
commit | 19fc7ae8d2bf66e5b313312a26276275340c01c7 (patch) | |
tree | 1ca5b8aa81fe0ac764dc2d36e6ce1051d1bb78bc /src/plugins | |
parent | 7e83c7278be624a136cd6e70426cb66ade66c903 (diff) |
Clean up a couple of memory leaks, clean up disposal/finalization on a few
2008-02-05 Philip Withnall <pwithnall@svn.gnome.org>
* src/plugins/properties/totem-movie-properties.c:
(totem_movie_properties_plugin_class_init):
* src/plugins/skipto/totem-skipto.c: (totem_skipto_class_init),
(totem_skipto_dispose):
* src/plugins/totem-module.c: (totem_module_finalize):
* src/plugins/totem-plugin.c: (totem_get_plugin_paths):
* src/plugins/totem-plugins-engine.c:
(totem_plugins_engine_load):
* src/plugins/tracker/totem-tracker-widget.c: (populate_result):
* src/totem-fullscreen.c: (totem_fullscreen_move_popups),
(totem_fullscreen_new), (totem_fullscreen_set_video_widget),
(totem_fullscreen_set_parent_window), (totem_fullscreen_init),
(totem_fullscreen_dispose), (totem_fullscreen_finalize),
(totem_fullscreen_class_init):
* src/totem-fullscreen.h:
* src/totem-menu.c: (add_device_to_menu),
(show_controls_action_callback):
* src/totem-open-location.c: (totem_open_location_class_init),
(totem_open_location_init), (totem_open_location_dispose),
(totem_open_location_new):
* src/totem-time-label.c: (totem_time_label_init),
(totem_time_label_new), (totem_time_label_class_init),
(totem_time_label_set_time):
* src/totem-time-label.h:
* src/totem-uri.c: (totem_setup_file_filters),
(totem_destroy_file_filters):
* src/totem-video-list.c: (totem_video_list_new),
(totem_video_list_class_init), (totem_video_list_init),
(totem_video_list_dispose): Clean up a couple of memory leaks,
clean up disposal/finalization on a few classes, and fix some
style issues. Also, fix user plugins being disabled when enabled
in GConf. (Closes: #513757)
svn path=/trunk/; revision=5071
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/properties/totem-movie-properties.c | 10 | ||||
-rw-r--r-- | src/plugins/skipto/totem-skipto.c | 18 | ||||
-rw-r--r-- | src/plugins/totem-module.c | 1 | ||||
-rw-r--r-- | src/plugins/totem-plugin.c | 2 | ||||
-rw-r--r-- | src/plugins/totem-plugins-engine.c | 1 | ||||
-rw-r--r-- | src/plugins/tracker/totem-tracker-widget.c | 2 |
6 files changed, 16 insertions, 18 deletions
diff --git a/src/plugins/properties/totem-movie-properties.c b/src/plugins/properties/totem-movie-properties.c index 318944a6..a4749aeb 100644 --- a/src/plugins/properties/totem-movie-properties.c +++ b/src/plugins/properties/totem-movie-properties.c @@ -62,7 +62,6 @@ G_MODULE_EXPORT GType register_totem_plugin (GTypeModule *module); GType totem_movie_properties_plugin_get_type (void) G_GNUC_CONST; static void totem_movie_properties_plugin_init (TotemMoviePropertiesPlugin *plugin); -static void totem_movie_properties_plugin_finalize (GObject *object); static gboolean impl_activate (TotemPlugin *plugin, TotemObject *totem, GError **error); static void impl_deactivate (TotemPlugin *plugin, TotemObject *totem); @@ -71,11 +70,8 @@ TOTEM_PLUGIN_REGISTER(TotemMoviePropertiesPlugin, totem_movie_properties_plugin) static void totem_movie_properties_plugin_class_init (TotemMoviePropertiesPluginClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); TotemPluginClass *plugin_class = TOTEM_PLUGIN_CLASS (klass); - object_class->finalize = totem_movie_properties_plugin_finalize; - plugin_class->activate = impl_activate; plugin_class->deactivate = impl_deactivate; } @@ -86,12 +82,6 @@ totem_movie_properties_plugin_init (TotemMoviePropertiesPlugin *plugin) } static void -totem_movie_properties_plugin_finalize (GObject *object) -{ - G_OBJECT_CLASS (totem_movie_properties_plugin_parent_class)->finalize (object); -} - -static void stream_length_notify_cb (TotemObject *totem, GParamSpec *arg1, TotemMoviePropertiesPlugin *plugin) diff --git a/src/plugins/skipto/totem-skipto.c b/src/plugins/skipto/totem-skipto.c index 95ba1181..565d165c 100644 --- a/src/plugins/skipto/totem-skipto.c +++ b/src/plugins/skipto/totem-skipto.c @@ -43,10 +43,9 @@ #include "video-utils.h" #include "bacon-video-widget.h" -static GObjectClass *parent_class = NULL; static void totem_skipto_class_init (TotemSkiptoClass *class); static void totem_skipto_init (TotemSkipto *ggo); -static void totem_skipto_finalize (GObject *object); +static void totem_skipto_dispose (GObject *object); /* Callback functions for GtkBuilder */ void spin_button_activate_cb (GtkEntry *entry, TotemSkipto *skipto); @@ -61,16 +60,16 @@ struct TotemSkiptoPrivate { }; TOTEM_PLUGIN_DEFINE_TYPE (TotemSkipto, totem_skipto, GTK_TYPE_DIALOG) +#define TOTEM_SKIPTO_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TOTEM_TYPE_SKIPTO, TotemSkiptoPrivate)) static void totem_skipto_class_init (TotemSkiptoClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (TotemSkiptoPrivate)); - object_class->finalize = totem_skipto_finalize; + object_class->dispose = totem_skipto_dispose; } static void @@ -92,11 +91,16 @@ totem_skipto_init (TotemSkipto *skipto) } static void -totem_skipto_finalize (GObject *object) +totem_skipto_dispose (GObject *object) { - g_return_if_fail (object != NULL); + TotemSkiptoPrivate *priv = TOTEM_SKIPTO_GET_PRIVATE (object); - G_OBJECT_CLASS (parent_class)->finalize (object); + if (priv->xml != NULL) { + g_object_unref (priv->xml); + priv->xml = NULL; + } + + G_OBJECT_CLASS (totem_skipto_parent_class)->dispose (object); } void diff --git a/src/plugins/totem-module.c b/src/plugins/totem-module.c index bc5e090a..e0431a7f 100644 --- a/src/plugins/totem-module.c +++ b/src/plugins/totem-module.c @@ -137,6 +137,7 @@ totem_module_finalize (GObject *object) TotemModule *module = TOTEM_MODULE (object); g_free (module->path); + g_free (module->name); G_OBJECT_CLASS (parent_class)->finalize (object); } diff --git a/src/plugins/totem-plugin.c b/src/plugins/totem-plugin.c index 1c75c551..1fa89432 100644 --- a/src/plugins/totem-plugin.c +++ b/src/plugins/totem-plugin.c @@ -214,7 +214,7 @@ totem_get_plugin_paths (void) paths = NULL; client = gconf_client_get_default (); - if (gconf_client_get_bool (client, GCONF_PREFIX"/disable_user_plugins", NULL) != FALSE) { + if (gconf_client_get_bool (client, GCONF_PREFIX"/disable_user_plugins", NULL) == FALSE) { path = g_build_filename (totem_dot_dir (), "plugins", NULL); paths = g_list_prepend (paths, path); } diff --git a/src/plugins/totem-plugins-engine.c b/src/plugins/totem-plugins-engine.c index 94d69cf7..ff01a47d 100644 --- a/src/plugins/totem-plugins-engine.c +++ b/src/plugins/totem-plugins-engine.c @@ -162,6 +162,7 @@ totem_plugins_engine_load (const gchar *file) #ifndef ENABLE_PYTHON g_debug ("Cannot load Python extension '%s', Totem was not " "compiled with Python support", file); + g_free (str); goto error; #endif } else { diff --git a/src/plugins/tracker/totem-tracker-widget.c b/src/plugins/tracker/totem-tracker-widget.c index dbf1d2ee..45941a7b 100644 --- a/src/plugins/tracker/totem-tracker-widget.c +++ b/src/plugins/tracker/totem-tracker-widget.c @@ -162,6 +162,8 @@ populate_result (TotemTrackerWidget *widget, char *result) g_free (thumbnail_path); g_free (file_uri); + if (thumbnail != NULL) + g_object_unref (thumbnail); } else { /* Display an error */ char *message = g_strdup_printf (_("Could not get metadata for file %s."), result); |