diff options
-rw-r--r-- | intern/cycles/render/alembic.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/intern/cycles/render/alembic.cpp b/intern/cycles/render/alembic.cpp index e0e50d99f84..a9d43415865 100644 --- a/intern/cycles/render/alembic.cpp +++ b/intern/cycles/render/alembic.cpp @@ -1317,12 +1317,24 @@ AlembicProcedural::~AlembicProcedural() foreach (Node *node, objects) { AlembicObject *abc_object = static_cast<AlembicObject *>(node); - objects_set.insert(abc_object->get_object()); - geometries_set.insert(abc_object->get_object()->get_geometry()); + if (abc_object->get_object()) { + objects_set.insert(abc_object->get_object()); + + if (abc_object->get_object()->get_geometry()) { + geometries_set.insert(abc_object->get_object()->get_geometry()); + } + } delete_node(abc_object); } + /* We may delete a Procedural before rendering started, so scene_ can be null. */ + if (!scene_) { + assert(geometries_set.empty()); + assert(objects_set.empty()); + return; + } + scene_->delete_nodes(geometries_set, this); scene_->delete_nodes(objects_set, this); } |