forked from AuroraMiddleware/gtk
Fix error case in filesystem model
We should not unref the model here, it might not even exist anymore.
Instead check if it exists and only use it if it does.
The unref was leftover from a previous fix in
ba9f53397f
.
Spotted by Matthias Clasen in
https://bugzilla.gnome.org/show_bug.cgi?id=614099
This commit is contained in:
parent
b84d4a308e
commit
9514e741cd
@ -1199,9 +1199,11 @@ gtk_file_system_model_got_enumerator (GObject *dir, GAsyncResult *res, gpointer
|
|||||||
enumerator = g_file_enumerate_children_finish (G_FILE (dir), res, &error);
|
enumerator = g_file_enumerate_children_finish (G_FILE (dir), res, &error);
|
||||||
if (enumerator == NULL)
|
if (enumerator == NULL)
|
||||||
{
|
{
|
||||||
g_signal_emit (model, file_system_model_signals[FINISHED_LOADING], 0, error);
|
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||||
g_object_unref (model);
|
{
|
||||||
g_error_free (error);
|
g_signal_emit (model, file_system_model_signals[FINISHED_LOADING], 0, error);
|
||||||
|
g_error_free (error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user