Skip to content

Commit f1c4a29

Browse files
committed
all: Fix some memory leaks
1 parent e97e303 commit f1c4a29

8 files changed

Lines changed: 14 additions & 1 deletion

File tree

libnemo-private/nemo-directory-async.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3654,6 +3654,7 @@ thumbnail_done (NemoDirectory *directory,
36543654
file->details->thumbnail_throttle_count = 1;
36553655
} else {
36563656
g_free (file->details->thumbnail_path);
3657+
g_object_unref (pixbuf);
36573658
file->details->thumbnail_path = NULL;
36583659
}
36593660

libnemo-private/nemo-icon-container.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2777,6 +2777,7 @@ finalize (GObject *object)
27772777
g_slice_free (NemoViewLayoutConstants, details->view_constants);
27782778

27792779
g_free (details);
2780+
g_list_free (details->current_selection);
27802781

27812782
G_OBJECT_CLASS (nemo_icon_container_parent_class)->finalize (object);
27822783
}

libnemo-private/nemo-thumbnails.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ thumbnail_thread_starter_cb (gpointer data)
611611
thumbnail_thread_is_running = TRUE;
612612

613613
g_task_run_in_thread (thumbnail_task, thumbnail_thread);
614+
g_object_unref (thumbnail_task);
614615

615616
thumbnail_thread_starter_id = 0;
616617
return FALSE;

src/nemo-application.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ nemo_application_quit_mainloop (GApplication *app)
576576

577577
nemo_icon_info_clear_caches ();
578578
save_accel_map (NULL);
579+
g_object_unref (NEMO_APPLICATION (app)->undo_manager);
579580

580581
nemo_application_notify_unmount_done (NEMO_APPLICATION (app), NULL);
581582

src/nemo-pathbar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ nemo_path_bar_finalize (GObject *object)
400400
g_clear_object (&path_bar->priv->xdg_public_path);
401401
g_clear_object (&path_bar->priv->xdg_templates_path);
402402
g_clear_object (&path_bar->priv->xdg_videos_path);
403+
g_clear_object (&path_bar->priv->desktop_path);
403404

404405
g_signal_handlers_disconnect_by_func (nemo_preferences,
405406
desktop_location_changed_callback,

src/nemo-places-sidebar.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4304,6 +4304,9 @@ nemo_places_sidebar_dispose (GObject *object)
43044304

43054305
g_clear_object (&sidebar->store);
43064306

4307+
g_clear_pointer (&sidebar->top_bookend_uri, g_free);
4308+
g_clear_pointer (&sidebar->bottom_bookend_uri, g_free);
4309+
43074310
if (sidebar->go_to_after_mount_slot) {
43084311
g_object_remove_weak_pointer (G_OBJECT (sidebar->go_to_after_mount_slot),
43094312
(gpointer *) &sidebar->go_to_after_mount_slot);

src/nemo-query-editor.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ nemo_query_editor_dispose (GObject *object)
102102
editor = NEMO_QUERY_EDITOR (object);
103103

104104
g_clear_pointer (&editor->priv->base_uri, g_free);
105+
g_clear_pointer (&editor->priv->last_set_query_text, g_free);
105106

106107
if (editor->priv->typing_timeout_id > 0) {
107108
g_source_remove (editor->priv->typing_timeout_id);
@@ -299,6 +300,7 @@ add_key_to_faves (NemoQueryEditor *editor,
299300
on_saved_searches_setting_changed,
300301
editor);
301302

303+
g_clear_pointer (&editor->priv->faves, g_strfreev);
302304
editor->priv->faves = (gchar **) g_ptr_array_free (array, FALSE);
303305
}
304306

@@ -351,6 +353,7 @@ remove_key_from_faves (NemoQueryEditor *editor,
351353
g_free (key);
352354
g_free (uri);
353355

356+
g_clear_pointer (&editor->priv->faves, g_strfreev);
354357
editor->priv->faves = (gchar **) g_ptr_array_free (array, FALSE);
355358
}
356359

@@ -455,6 +458,7 @@ on_menu_item_activated (GtkMenuItem *item,
455458

456459
g_free (favorite_location);
457460
g_free (favorite_key);
461+
g_object_unref (query);
458462
}
459463
}
460464

@@ -699,6 +703,7 @@ on_saved_searches_setting_changed (GSettings *settings,
699703

700704
editor = NEMO_QUERY_EDITOR (user_data);
701705

706+
g_clear_pointer (&editor->priv->faves, g_strfreev);
702707
editor->priv->faves = g_settings_get_strv (settings, key);
703708
}
704709

src/nemo-view.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5072,7 +5072,7 @@ setup_bookmark_action( char *action_name,
50725072
action_name,
50735073
GTK_UI_MANAGER_MENUITEM,
50745074
FALSE);
5075-
5075+
g_object_unref (action);
50765076
g_free (action_name);
50775077
}
50785078

0 commit comments

Comments
 (0)