Commit 7138f32e authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

fixed some memory leaks

parent c9c54e9a
......@@ -125,6 +125,7 @@ update_system_bookmark_list_from_content (GthBrowser *browser,
g_menu_item_set_action_and_target (item, "win.go-to-location", "s", uri);
g_menu_append_item (data->system_bookmarks_menu, item);
g_object_unref (item);
g_free (name);
g_object_unref (file);
g_strfreev (line);
......@@ -242,7 +243,7 @@ _gth_browser_update_bookmark_list (GthBrowser *browser)
g_menu_item_set_action_and_target (item, "win.go-to-location", "s", uris[i]);
g_menu_append_item (data->bookmarks_menu, item);
_g_object_unref (item);
g_object_unref (item);
g_free (name);
g_object_unref (file);
}
......
......@@ -149,8 +149,10 @@ gth_file_properties_real_set_file (GthPropertyView *base,
continue;
value = gth_file_data_get_attribute_as_string (file_data, info->id);
if ((value == NULL) || (*value == '\0'))
if ((value == NULL) || (*value == '\0')) {
g_free (value);
continue;
}
if (info->id != NULL) {
if (g_str_has_prefix (info->id, "Exif")) {
......
......@@ -111,9 +111,10 @@ gth_file_source_vfs_add_uri (GList *list,
static GList *
gth_file_source_vfs_get_entry_points (GthFileSource *file_source)
{
GList *list;
GList *mounts;
GList *scan;
GList *list;
GVolumeMonitor *monitor;
GList *mounts;
GList *scan;
list = NULL;
......@@ -123,7 +124,8 @@ gth_file_source_vfs_get_entry_points (GthFileSource *file_source)
list = gth_file_source_vfs_add_special_dir (list, file_source, G_USER_DIRECTORY_DOWNLOAD);
list = gth_file_source_vfs_add_uri (list, file_source, "file:///");
mounts = g_volume_monitor_get_mounts (g_volume_monitor_get ());
monitor = g_volume_monitor_get ();
mounts = g_volume_monitor_get_mounts (monitor);
for (scan = mounts; scan; scan = scan->next) {
GMount *mount = scan->data;
GIcon *icon;
......@@ -170,6 +172,7 @@ gth_file_source_vfs_get_entry_points (GthFileSource *file_source)
}
_g_object_list_unref (mounts);
g_object_unref (monitor);
return list;
}
......@@ -219,6 +222,7 @@ gth_file_source_vfs_get_file_info (GthFileSource *file_source,
else if (g_strcmp0 (uri, get_home_uri ()) == 0)
g_file_info_set_display_name (file_info, _("Home Folder"));
g_free (uri);
g_object_unref (gio_file);
return file_info;
......
......@@ -55,6 +55,8 @@ gth_main_register_default_file_loader (void)
g_strfreev (mime_types);
}
g_slist_free (formats);
}
......
......@@ -193,7 +193,7 @@ gth_menu_manager_append_entries (GthMenuManager *menu_manager,
GList *items;
int i;
g_return_if_fail (menu_manager != NULL);
g_return_val_if_fail (menu_manager != NULL, 0);
merge_id = gth_menu_manager_new_merge_id (menu_manager);
items = NULL;
......
......@@ -511,6 +511,7 @@ is_a_cache_file (const char *uri)
g_free (cache_dir_1);
g_free (cache_dir_2);
g_free (filename);
return result;
}
......
......@@ -257,6 +257,7 @@ gth_window_realize (GtkWidget *widget)
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (css_provider);
g_bytes_unref (bytes);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment