From d130806ade2b9bb404e1267262ca4859c15c01a0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 2 Oct 2007 04:17:53 +0000 Subject: Fix deadlock on patch save. git-svn-id: http://svn.drobilla.net/lad/ingen@800 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/Serializer.cpp | 19 ++++--------------- src/libs/client/Serializer.hpp | 3 +-- 2 files changed, 5 insertions(+), 17 deletions(-) (limited to 'src/libs/client') diff --git a/src/libs/client/Serializer.cpp b/src/libs/client/Serializer.cpp index d3d3abfd..1652e546 100644 --- a/src/libs/client/Serializer.cpp +++ b/src/libs/client/Serializer.cpp @@ -151,10 +151,14 @@ Serializer::path_to_node_id(const Path& path) NodeMap::iterator i = _node_map.find(path); if (i != _node_map.end()) { + assert(i->second); + assert(i->second.get_node()); return i->second; } else { Node id = _world.blank_id(); + assert(id); _node_map[path] = id; + assert(_node_map[path]); return id; } } @@ -417,24 +421,9 @@ Serializer::serialize_connection(SharedPtr connection) throw (s if (!_model) throw std::logic_error("serialize_connection called without serialization in progress"); - const Node connection_id = Node(_model->world(), Node::BLANK, - path_to_node_id(connection->src_port_path()).to_string() - + "-" + path_to_node_id(connection->dst_port_path()).to_string()); - _model->add_statement(path_to_node_id(connection->dst_port_path()), "ingen:connectedTo", path_to_node_id(connection->src_port_path())); - - /*_model->add_statement(connection_id, "rdf:type", "ingen:Connection"; - - _model->add_statement(connection_id, - "ingen:source", - path_to_node_id(connection->src_port_path())); - - _model->add_statement(connection_id, - "ingen:destination", - path_to_node_id(connection->dst_port_path())); - */ } diff --git a/src/libs/client/Serializer.hpp b/src/libs/client/Serializer.hpp index bb3b0e8a..4a6cfa6a 100644 --- a/src/libs/client/Serializer.hpp +++ b/src/libs/client/Serializer.hpp @@ -28,7 +28,6 @@ #include #include #include -#include #include "ObjectModel.hpp" namespace Ingen { @@ -75,7 +74,7 @@ private: Raul::RDF::Node path_to_node_id(const Path& path); Raul::RDF::Node patch_path_to_rdf_id(const Path& path); - typedef Raul::PathTable NodeMap; + typedef std::map NodeMap; SharedPtr _root_object; Mode _mode; -- cgit v1.2.1