[Bf-blender-cvs] [43a910abce5] master: Alembic import: prevent crash when cancelling import.
Sybren A. Stüvel
noreply at git.blender.org
Fri Apr 7 16:05:41 CEST 2017
Commit: 43a910abce50963d12c0ccde596347459d921b9a
Author: Sybren A. Stüvel
Date: Fri Apr 7 16:03:16 2017 +0200
Branches: master
https://developer.blender.org/rB43a910abce50963d12c0ccde596347459d921b9a
Alembic import: prevent crash when cancelling import.
It's possible that cancellation occured between the creation of the reader
and the creation of the Blender object, in which case reader->object()
returns a NULL pointer.
===================================================================
M source/blender/alembic/intern/alembic_capi.cc
===================================================================
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index c16a2089982..9529b370928 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -766,6 +766,9 @@ static void import_endjob(void *user_data)
for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
Object *ob = (*iter)->object();
+ /* It's possible that cancellation occured between the creation of
+ * the reader and the creation of the Blender object. */
+ if (ob == NULL) continue;
BKE_libblock_free_us(data->bmain, ob);
}
More information about the Bf-blender-cvs
mailing list