summaryrefslogtreecommitdiffstats
path: root/src/libs/client/Store.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-06-12 04:48:20 +0000
committerDavid Robillard <d@drobilla.net>2006-06-12 04:48:20 +0000
commitefee2b08f575e2c216cffa6f08a928223ab2cedb (patch)
tree089fdf9bc89aa04793b03cbfccb438a7a9c9f387 /src/libs/client/Store.cpp
parent5818a04533e472820f6c6748b2f07d7d1ca5789a (diff)
downloadingen-efee2b08f575e2c216cffa6f08a928223ab2cedb.tar.gz
ingen-efee2b08f575e2c216cffa6f08a928223ab2cedb.tar.bz2
ingen-efee2b08f575e2c216cffa6f08a928223ab2cedb.zip
Store memory bug fixes (multiple ref ptr's to the same object, bad),
control panel fixes git-svn-id: http://svn.drobilla.net/lad/grauph@32 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/Store.cpp')
-rw-r--r--src/libs/client/Store.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp
index cd52af70..21470f41 100644
--- a/src/libs/client/Store.cpp
+++ b/src/libs/client/Store.cpp
@@ -207,11 +207,13 @@ Store::new_node_event(const string& plugin_type, const string& plugin_uri, const
std::map<string, CountedPtr<ObjectModel> >::iterator pi = m_objects.find(n->path().parent());
if (pi != m_objects.end()) {
- PatchModel* parent = dynamic_cast<PatchModel*>((*pi).second.get());
- if (parent)
+ CountedPtr<PatchModel> parent = (*pi).second;
+ if (parent) {
+ n->set_parent(parent);
parent->add_node(n);
- else
+ } else {
cerr << "ERROR: new node with no parent" << endl;
+ }
}
}
}
@@ -251,7 +253,8 @@ Store::new_port_event(const string& path, const string& type, bool is_output)
std::map<string, CountedPtr<ObjectModel> >::iterator pi = m_objects.find(p->path().parent());
if (pi != m_objects.end()) {
- NodeModel* parent = dynamic_cast<NodeModel*>((*pi).second.get());
+ CountedPtr<NodeModel> parent = (*pi).second;
+ p->set_parent(parent);
if (parent)
parent->add_port(p);
else