From 00f2ad0069fe4e51e40e6a3b3d41f125b67f89cf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 7 Jun 2011 02:44:16 +0000 Subject: Remove use of smart pointers in FlowCanvas entirely. Since FlowCanvas's containers own their children, there is no real benefit to using smart pointers for objects, though there is overhead. There are no longer any add or remove methods for containers, simply create (new) and destroy (delete) objects and things should work as expected. git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@3366 a436a847-0d15-0410-975c-d299462d15a1 --- src/Patchage.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/Patchage.cpp') diff --git a/src/Patchage.cpp b/src/Patchage.cpp index bfb067c..9dbc3c5 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -512,7 +512,7 @@ Patchage::update_state() { for (FlowCanvas::Canvas::Items::iterator i = _canvas->items().begin(); i != _canvas->items().end(); ++i) { - SharedPtr module = PtrCast(*i); + FlowCanvas::Module* module = dynamic_cast(*i); if (module) module->load_location(); } @@ -628,12 +628,10 @@ Patchage::save_session(bool close) script << "sleep 3" << endl; script << endl; - for (FlowCanvas::ConnectionList::const_iterator c = _canvas->connections().begin(); + for (FlowCanvas::Canvas::Connections::const_iterator c = _canvas->connections().begin(); c != _canvas->connections().end(); ++c) { - boost::shared_ptr src - = boost::dynamic_pointer_cast((*c)->source().lock()); - boost::shared_ptr dst - = boost::dynamic_pointer_cast((*c)->dest().lock()); + PatchagePort* src = dynamic_cast((*c)->source()); + PatchagePort* dst = dynamic_cast((*c)->dest()); if (!src || !dst || src->type() == ALSA_MIDI || dst->type() == ALSA_MIDI) { continue; -- cgit v1.2.1