Plug two memory leaks
This commit is contained in:
parent
b6315482b7
commit
efc13db66e
11
fiv-io.c
11
fiv-io.c
|
@ -2939,7 +2939,7 @@ model_reload(FivIoModel *self, GError **error)
|
|||
if (self->filtering && g_file_info_get_is_hidden(info))
|
||||
continue;
|
||||
|
||||
ModelEntry entry = {};
|
||||
ModelEntry entry = {.uri = g_file_get_uri(child)};
|
||||
GDateTime *mtime = g_file_info_get_modification_date_time(info);
|
||||
if (mtime) {
|
||||
entry.mtime_msec = g_date_time_to_unix(mtime) * 1000 +
|
||||
|
@ -2954,13 +2954,12 @@ model_reload(FivIoModel *self, GError **error)
|
|||
g_free(parse_name);
|
||||
|
||||
const char *name = g_file_info_get_name(info);
|
||||
if (g_file_info_get_file_type(info) == G_FILE_TYPE_DIRECTORY) {
|
||||
entry.uri = g_file_get_uri(child);
|
||||
if (g_file_info_get_file_type(info) == G_FILE_TYPE_DIRECTORY)
|
||||
g_array_append_val(self->subdirs, entry);
|
||||
} else if (!self->filtering || model_supports(self, name)) {
|
||||
entry.uri = g_file_get_uri(child);
|
||||
else if (!self->filtering || model_supports(self, name))
|
||||
g_array_append_val(self->files, entry);
|
||||
}
|
||||
else
|
||||
model_entry_finalize(&entry);
|
||||
}
|
||||
g_object_unref(enumerator);
|
||||
|
||||
|
|
|
@ -209,6 +209,7 @@ create_row(FivSidebar *self, GFile *file, const char *icon_name)
|
|||
|
||||
gtk_container_add(GTK_CONTAINER(row), revealer);
|
||||
gtk_widget_show_all(row);
|
||||
g_object_unref(info);
|
||||
return row;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue