mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
More gio-du win32 fixes
Don't free the utf8 filename before the async function completes. also, gitignore
This commit is contained in:
parent
6d08d1191b
commit
abf505fd0e
1
gio/tests/.gitignore
vendored
1
gio/tests/.gitignore
vendored
@ -69,6 +69,7 @@ gdbus-test-codegen-generated*
|
||||
gdbus-test-fixture
|
||||
gdbus-testserver
|
||||
gdbus-threading
|
||||
gio-du
|
||||
g-file
|
||||
g-file-info
|
||||
g-icon
|
||||
|
@ -58,7 +58,7 @@ async_ready_func (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
const gchar *filename = user_data;
|
||||
gchar *filename = user_data;
|
||||
GError *error = NULL;
|
||||
guint64 disk_usage;
|
||||
guint64 num_dirs;
|
||||
@ -67,6 +67,7 @@ async_ready_func (GObject *source,
|
||||
g_file_measure_disk_usage_finish (G_FILE (source), result, &disk_usage, &num_dirs, &num_files, &error);
|
||||
print_result (filename, disk_usage, num_dirs, num_files, error, '\n');
|
||||
outstanding_asyncs--;
|
||||
g_free (filename);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -143,7 +144,7 @@ main (int argc, char **argv)
|
||||
#else
|
||||
while (argv[i])
|
||||
{
|
||||
gchar *argv_utf8 = argv[i];
|
||||
gchar *argv_utf8 = g_strdup (argv[i]);
|
||||
#endif
|
||||
GFile *file = g_file_new_for_commandline_arg (argv_utf8);
|
||||
|
||||
@ -163,12 +164,10 @@ main (int argc, char **argv)
|
||||
g_file_measure_disk_usage (file, flags, NULL, progress, argv_utf8,
|
||||
&disk_usage, &num_dirs, &num_files, &error);
|
||||
print_result (argv_utf8, disk_usage, num_dirs, num_files, error, '\n');
|
||||
g_free (argv_utf8);
|
||||
}
|
||||
|
||||
g_object_unref (file);
|
||||
#ifdef G_OS_WIN32
|
||||
g_free (argv_utf8);
|
||||
#endif
|
||||
|
||||
i++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user