diff options
author | David Robillard <d@drobilla.net> | 2013-12-31 05:47:26 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-12-31 05:47:26 +0000 |
commit | d05d7e4267eca39d8d54fb0d199a450b364b77c3 (patch) | |
tree | cd446d0786546367cd04f4c17e0878001fb32260 /src | |
parent | c8a1355b8f612048ca3169df78f4f1dbad50c6ac (diff) | |
download | ingen-d05d7e4267eca39d8d54fb0d199a450b364b77c3.tar.gz ingen-d05d7e4267eca39d8d54fb0d199a450b364b77c3.tar.bz2 ingen-d05d7e4267eca39d8d54fb0d199a450b364b77c3.zip |
Fix crash on bulk deletion and AtomWriter forge errors.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5240 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/AtomWriter.cpp | 6 | ||||
-rw-r--r-- | src/client/ClientStore.cpp | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/AtomWriter.cpp b/src/AtomWriter.cpp index 7afd6056..8b2d90c5 100644 --- a/src/AtomWriter.cpp +++ b/src/AtomWriter.cpp @@ -14,6 +14,7 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ +#include <cassert> #include <string> #include "ingen/AtomSink.hpp" @@ -58,6 +59,7 @@ AtomWriter::AtomWriter(URIMap& map, URIs& uris, AtomSink& sink) void AtomWriter::finish_msg() { + assert(!_forge.stack); _sink.write((const LV2_Atom*)_out.buf); _out.len = 0; } @@ -174,6 +176,8 @@ AtomWriter::move(const Raul::Path& old_path, forge_uri(Node::path_to_uri(old_path)); lv2_atom_forge_property_head(&_forge, _uris.patch_destination, 0); forge_uri(Node::path_to_uri(new_path)); + lv2_atom_forge_pop(&_forge, &msg); + finish_msg(); } void @@ -183,6 +187,8 @@ AtomWriter::del(const Raul::URI& uri) lv2_atom_forge_blank(&_forge, &msg, next_id(), _uris.patch_Delete); lv2_atom_forge_property_head(&_forge, _uris.patch_subject, 0); forge_uri(uri); + lv2_atom_forge_pop(&_forge, &msg); + finish_msg(); } void diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 9882d2d5..56c74cd8 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -105,12 +105,13 @@ ClientStore::remove_object(const Raul::Path& path) return SPtr<ObjectModel>(); } + SPtr<ObjectModel> object = dynamic_ptr_cast<ObjectModel>(top->second); + // Remove the object and all its descendants Objects removed; remove(top, removed); // Notify everything that needs to know this object is going away - SPtr<ObjectModel> object = dynamic_ptr_cast<ObjectModel>(top->second); if (object) { // Notify the program this object is going away object->signal_destroyed().emit(); |