--- a/src/basics.cpp Sat Jan 28 17:47:06 2017 +0200 +++ b/src/basics.cpp Sun Jan 29 15:05:14 2017 +0200 @@ -151,11 +151,13 @@ break; case OBJ_SubfileReference: - for (LDObject* it : static_cast<LDSubfileReference*> (obj)->inlineContents (true, false)) - { - calcObject (it); - it->destroy(); - } + { + Model model; + static_cast<LDSubfileReference*>(obj)->inlineContents(model, true, false); + + for (LDObject* it : model.objects()) + calcObject(it); + } break; default: