Merge branch 'plug-leak' into 'main'

filechooser: Plug a leak

See merge request GNOME/gtk!7705
This commit is contained in:
Matthias Clasen 2024-09-11 00:09:05 +00:00
commit 0a9b501743
2 changed files with 6 additions and 2 deletions

View File

@ -798,7 +798,8 @@ gtk_directory_list_start_monitoring (GtkDirectoryList *self)
{
g_assert (self->monitor == NULL);
self->monitor = g_file_monitor_directory (self->file, G_FILE_MONITOR_WATCH_MOVES, NULL, NULL);
g_signal_connect (self->monitor, "changed", G_CALLBACK (directory_changed), self);
if (self->monitor)
g_signal_connect (self->monitor, "changed", G_CALLBACK (directory_changed), self);
}
static void

View File

@ -4787,7 +4787,10 @@ gtk_file_chooser_widget_get_files (GtkFileChooser *chooser)
current_folder = gtk_file_chooser_get_current_folder (chooser);
if (current_folder)
g_list_store_append (result, current_folder);
{
g_list_store_append (result, current_folder);
g_object_unref (current_folder);
}
}
return G_LIST_MODEL (result);