From 48eff0da05d4203013835ed500bade593f842557 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 3 Jun 2011 18:14:32 +0000 Subject: Remove use of boost::enable_shared_from_this. 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/patchage@3354 a436a847-0d15-0410-975c-d299462d15a1 --- src/AlsaDriver.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/AlsaDriver.cpp') diff --git a/src/AlsaDriver.cpp b/src/AlsaDriver.cpp index f744b5f..56bef22 100644 --- a/src/AlsaDriver.cpp +++ b/src/AlsaDriver.cpp @@ -218,10 +218,8 @@ AlsaDriver::create_port(boost::shared_ptr parent, new PatchagePort(parent, ALSA_MIDI, name, is_input, _app->state_manager()->get_port_color(ALSA_MIDI))); - boost::shared_ptr canvas - = boost::dynamic_pointer_cast(parent->canvas().lock()); - if (canvas) - canvas->index_port(PortID(addr, is_input), ret); + dynamic_cast(parent->canvas())->index_port( + PortID(addr, is_input), ret); ret->alsa_addr(addr); return ret; -- cgit v1.2.1