Bug fixes.
git-svn-id: http://svn.drobilla.net/lad@130 a436a847-0d15-0410-975c-d299462d15a1
This commit is contained in:
parent
8ce986cd98
commit
fac9203a82
|
@ -36,14 +36,14 @@ namespace boost {
|
|||
assert(std::find(counted_ptr_counters.begin(), counted_ptr_counters.end(),
|
||||
(void*)object) == counted_ptr_counters.end());
|
||||
counted_ptr_counters.push_back(object);
|
||||
//std::cerr << "Creating " << typeid(object).name() << " Pointer to "
|
||||
//<< object << std::endl;
|
||||
//std::cerr << "Creating CountedPtr to "
|
||||
// << object << ", count = " << cnt << std::endl;
|
||||
}
|
||||
|
||||
static void sp_scalar_destructor_hook(void* object, unsigned long cnt, void* ptr) {
|
||||
counted_ptr_counters.remove(object);
|
||||
//std::cerr << "Destroying " << typeid(object).name() << " Pointer to "
|
||||
//<< object << std::endl;
|
||||
//std::cerr << "Destroying CountedPtr to "
|
||||
// << object << ", count = " << cnt << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ NodeModel::NodeModel(const string& plugin_uri, const Path& path)
|
|||
NodeModel::~NodeModel()
|
||||
{
|
||||
clear();
|
||||
m_controller.reset();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -25,6 +25,10 @@ ObjectModel::ObjectModel(const Path& path)
|
|||
{
|
||||
}
|
||||
|
||||
ObjectModel::~ObjectModel()
|
||||
{
|
||||
m_controller.reset();
|
||||
}
|
||||
|
||||
/** Get a piece of metadata for this objeect.
|
||||
*
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -104,8 +104,10 @@ void
|
|||
NodeController::destroy()
|
||||
{
|
||||
cerr << "FIXME: NODE DESTROYED\n";
|
||||
destroy_module(); // cuts reference
|
||||
//delete this;
|
||||
destroy_module();
|
||||
CountedPtr<ObjectModel> model = m_model;
|
||||
m_model->controller().reset();
|
||||
m_model.reset();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue