Do not call g_object_unref when imageType comes out as UNKNOWN.

Avoids "(sharp:23220): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed" dumped to the console when an unsupported or invalid image is loaded.
This commit is contained in:
Andreas Lind 2014-10-23 08:32:19 +02:00
parent 49b44d8238
commit 005c628352

View File

@ -76,7 +76,9 @@ class MetadataWorker : public NanAsyncWorker {
}
}
// Clean up
g_object_unref(image);
if (imageType != UNKNOWN) {
g_object_unref(image);
}
vips_error_clear();
vips_thread_shutdown();
}