Commit abf505fd authored by Allison Karlitskaya's avatar Allison Karlitskaya

More gio-du win32 fixes

Don't free the utf8 filename before the async function completes.

also, gitignore
parent 6d08d119
......@@ -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++;
}
......
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