summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-04-09 22:45:43 +0000
committerDavid Robillard <d@drobilla.net>2007-04-09 22:45:43 +0000
commit441968a7932eeb1adc25e22134362176bb8c9a7b (patch)
tree5be9dd0128615cd3c1fd33fcefb4c3e37ddea2d5
parent6c9ce11ed66e15d02537e07bd767f5633471f71b (diff)
downloadingen-441968a7932eeb1adc25e22134362176bb8c9a7b.tar.gz
ingen-441968a7932eeb1adc25e22134362176bb8c9a7b.tar.bz2
ingen-441968a7932eeb1adc25e22134362176bb8c9a7b.zip
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
-rw-r--r--src/libs/client/Serializer.cpp6
1 files changed, 5 insertions, 1 deletions
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<PatchModel> 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<PatchModel> patch = PtrCast<PatchModel>(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) {