summaryrefslogtreecommitdiffstats
path: root/src/PatchageEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-06-07 02:44:16 +0000
committerDavid Robillard <d@drobilla.net>2011-06-07 02:44:16 +0000
commit00f2ad0069fe4e51e40e6a3b3d41f125b67f89cf (patch)
tree1a96d7873a700a05815bde3e3119b7055532d861 /src/PatchageEvent.cpp
parent9adc6fb021bcde9720a8afcac9a1a87521691fba (diff)
downloadpatchage-00f2ad0069fe4e51e40e6a3b3d41f125b67f89cf.tar.gz
patchage-00f2ad0069fe4e51e40e6a3b3d41f125b67f89cf.tar.bz2
patchage-00f2ad0069fe4e51e40e6a3b3d41f125b67f89cf.zip
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
Diffstat (limited to 'src/PatchageEvent.cpp')
-rw-r--r--src/PatchageEvent.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp
index e77de3f..d1afb1a 100644
--- a/src/PatchageEvent.cpp
+++ b/src/PatchageEvent.cpp
@@ -47,12 +47,11 @@ PatchageEvent::execute(Patchage* patchage)
_str = NULL;
} else if (_type == CLIENT_DESTRUCTION) {
- SharedPtr<PatchageModule> module = PtrCast<PatchageModule>(
+ PatchageModule* module = dynamic_cast<PatchageModule*>(
patchage->canvas()->find_module(_str, InputOutput));
if (module) {
patchage->canvas()->remove_item(module);
- module.reset();
}
free(_str);
@@ -72,7 +71,7 @@ PatchageEvent::execute(Patchage* patchage)
}
if (driver) {
- SharedPtr<PatchagePort> port = driver->create_port_view(patchage, _port_1);
+ PatchagePort* port = driver->create_port_view(patchage, _port_1);
if (port)
patchage->enqueue_resize(port->module());
else
@@ -83,17 +82,17 @@ PatchageEvent::execute(Patchage* patchage)
} else if (_type == PORT_DESTRUCTION) {
- SharedPtr<PatchagePort> port = patchage->canvas()->remove_port(_port_1);
+ PatchagePort* port = patchage->canvas()->remove_port(_port_1);
if (port) {
- port.reset();
+ delete port;
} else {
Raul::error << "Unable to find port `" << _port_1 << "' to destroy" << endl;
}
} else if (_type == CONNECTION) {
- SharedPtr<PatchagePort> port_1 = patchage->canvas()->find_port(_port_1);
- SharedPtr<PatchagePort> port_2 = patchage->canvas()->find_port(_port_2);
+ PatchagePort* port_1 = patchage->canvas()->find_port(_port_1);
+ PatchagePort* port_2 = patchage->canvas()->find_port(_port_2);
if (!port_1)
Raul::error << "Unable to find port `" << _port_1 << "' to connect" << endl;
@@ -104,8 +103,8 @@ PatchageEvent::execute(Patchage* patchage)
} else if (_type == DISCONNECTION) {
- SharedPtr<PatchagePort> port_1 = patchage->canvas()->find_port(_port_1);
- SharedPtr<PatchagePort> port_2 = patchage->canvas()->find_port(_port_2);
+ PatchagePort* port_1 = patchage->canvas()->find_port(_port_1);
+ PatchagePort* port_2 = patchage->canvas()->find_port(_port_2);
if (!port_1)
Raul::error << "Unable to find port `" << _port_1 << "' to disconnect" << endl;