From 441968a7932eeb1adc25e22134362176bb8c9a7b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 9 Apr 2007 22:45:43 +0000 Subject: Fix crash on saving recursive patches (don't load yet though). git-svn-id: http://svn.drobilla.net/lad/ingen@432 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/Serializer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libs/client/Serializer.cpp b/src/libs/client/Serializer.cpp index 68fcdd38..767d86d9 100644 --- a/src/libs/client/Serializer.cpp +++ b/src/libs/client/Serializer.cpp @@ -219,7 +219,11 @@ Serializer::serialize_patch(SharedPtr patch, unsigned depth) for (NodeModelMap::const_iterator n = patch->nodes().begin(); n != patch->nodes().end(); ++n) { _writer.write(patch_id, NS_INGEN("node"), path_to_node_id(n->second->path())); - serialize_node(n->second, depth+1); + SharedPtr patch = PtrCast(n->second); + if (patch) + serialize_patch(patch, depth+1); + else + serialize_node(n->second, depth+1); } for (PortModelList::const_iterator p = patch->ports().begin(); p != patch->ports().end(); ++p) { -- cgit v1.2.1