diff options
author | David Robillard <d@drobilla.net> | 2011-06-03 18:14:32 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-06-03 18:14:32 +0000 |
commit | 30e15b2f613d93eae8a4a122583dd0a16b1ab609 (patch) | |
tree | 9ab219bc86ffde3d571ccdee18794acbe8dbc747 /src/gui/NodeModule.cpp | |
parent | e15a1ca67583535193e3e2b13ff006d93a7dcf14 (diff) | |
download | ingen-30e15b2f613d93eae8a4a122583dd0a16b1ab609.tar.gz ingen-30e15b2f613d93eae8a4a122583dd0a16b1ab609.tar.bz2 ingen-30e15b2f613d93eae8a4a122583dd0a16b1ab609.zip |
Remove use of boost::enable_shared_from_this<Canvas>.
Instead, just store a pointer to the containing canvas in Items, since it should not be possible for an Item to outlive its containing Canvas anyway. Shrinks Item memory overhead a tad and gives a minor performance boost as an added bonus.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3354 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/NodeModule.cpp')
-rw-r--r-- | src/gui/NodeModule.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index a0a147c8..2c14557a 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -43,9 +43,9 @@ using namespace Raul; namespace Ingen { namespace GUI { -NodeModule::NodeModule(boost::shared_ptr<PatchCanvas> canvas, - SharedPtr<const NodeModel> node) - : FlowCanvas::Module(canvas, node->path().symbol(), 0, 0, true, canvas->show_port_names()) +NodeModule::NodeModule(PatchCanvas& canvas, + SharedPtr<const NodeModel> node) + : FlowCanvas::Module(canvas, node->path().symbol(), 0, 0, true, canvas.show_port_names()) , _node(node) , _gui_widget(NULL) , _gui_window(NULL) @@ -87,9 +87,9 @@ NodeModule::create_menu() } boost::shared_ptr<NodeModule> -NodeModule::create(boost::shared_ptr<PatchCanvas> canvas, - SharedPtr<const NodeModel> node, - bool human) +NodeModule::create(PatchCanvas& canvas, + SharedPtr<const NodeModel> node, + bool human) { boost::shared_ptr<NodeModule> ret; @@ -401,9 +401,9 @@ NodeModule::property_changed(const URI& key, const Atom& value) } else if (key == uris.ingen_selected) { if (value.get_bool() != selected()) { if (value.get_bool()) - _canvas.lock()->select_item(shared_from_this()); + _canvas->select_item(shared_from_this()); else - _canvas.lock()->unselect_item(shared_from_this()); + _canvas->unselect_item(shared_from_this()); } } break; |