summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/client/NodeModel.cpp1
-rw-r--r--src/libs/client/ObjectModel.cpp4
-rw-r--r--src/libs/client/ObjectModel.h2
-rw-r--r--src/libs/client/PatchModel.cpp2
-rw-r--r--src/libs/client/Store.cpp7
5 files changed, 13 insertions, 3 deletions
diff --git a/src/libs/client/NodeModel.cpp b/src/libs/client/NodeModel.cpp
index 80f8f03a..8d9d8697 100644
--- a/src/libs/client/NodeModel.cpp
+++ b/src/libs/client/NodeModel.cpp
@@ -45,7 +45,6 @@ NodeModel::NodeModel(const string& plugin_uri, const Path& path)
NodeModel::~NodeModel()
{
clear();
- m_controller.reset();
}
diff --git a/src/libs/client/ObjectModel.cpp b/src/libs/client/ObjectModel.cpp
index b8688585..4a0eca0d 100644
--- a/src/libs/client/ObjectModel.cpp
+++ b/src/libs/client/ObjectModel.cpp
@@ -25,6 +25,10 @@ ObjectModel::ObjectModel(const Path& path)
{
}
+ObjectModel::~ObjectModel()
+{
+ m_controller.reset();
+}
/** Get a piece of metadata for this objeect.
*
diff --git a/src/libs/client/ObjectModel.h b/src/libs/client/ObjectModel.h
index 744d78a0..da3764d1 100644
--- a/src/libs/client/ObjectModel.h
+++ b/src/libs/client/ObjectModel.h
@@ -46,7 +46,7 @@ public:
ObjectModel(const Path& path);
ObjectModel() : m_path("/UNINITIALIZED") {} // FIXME: remove
- virtual ~ObjectModel() {}
+ virtual ~ObjectModel();
const map<string, string>& metadata() const { return m_metadata; }
string get_metadata(const string& key) const;
diff --git a/src/libs/client/PatchModel.cpp b/src/libs/client/PatchModel.cpp
index 68a55b40..a65f1c49 100644
--- a/src/libs/client/PatchModel.cpp
+++ b/src/libs/client/PatchModel.cpp
@@ -129,6 +129,7 @@ PatchModel::remove_node(CountedPtr<NodeModel> nm)
assert(i->second == nm);
m_nodes.erase(i);
removed_node_sig.emit(nm->path().name());
+ i->second->parent().reset();
return;
}
@@ -146,6 +147,7 @@ PatchModel::remove_node(const string& name)
//delete i->second;
m_nodes.erase(i);
removed_node_sig.emit(name);
+ i->second->parent().reset();
return;
}
diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp
index c0bc1a31..df0bdd95 100644
--- a/src/libs/client/Store.cpp
+++ b/src/libs/client/Store.cpp
@@ -211,7 +211,12 @@ Store::add_plugin(CountedPtr<PluginModel> pm)
void
Store::destruction_event(const Path& path)
{
- remove_object(path);
+ CountedPtr<ObjectModel> removed = remove_object(path);
+ removed->controller().reset();
+ cerr << "Store removed object " << path
+ << " controller count: " << removed->controller().use_count();
+ removed.reset();
+ cerr << ", model count: " << removed.use_count() << endl;
}
void