From b94f199970e442b9fc8ae87702babf21677692ec Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 10 Oct 2006 19:51:35 +0000 Subject: add control port to ardour.rc.in and fix crash bug caused by bad shared_ptr(this) construct, seen when invoking "Original Position" from region context menu git-svn-id: svn://localhost/ardour2/trunk@973 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/audioregion.cc | 7 ++++++- libs/ardour/region.cc | 2 +- libs/ardour/session.cc | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'libs') diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 787b408ace..e403130882 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -1238,7 +1238,12 @@ AudioRegion::get_parent() boost::shared_ptr r; if (_playlist) { - r = _playlist->session().find_whole_file_parent (boost::shared_ptr(this)); + boost::shared_ptr ar; + boost::shared_ptr grrr2 = boost::dynamic_pointer_cast (shared_from_this()); + + if (grrr2 && (ar = _playlist->session().find_whole_file_parent (grrr2))) { + return boost::static_pointer_cast (ar); + } } return r; diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index a13ddd77cd..528bb52a01 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -293,7 +293,7 @@ Region::move_to_natural_position (void *src) if (!_playlist) { return; } - + boost::shared_ptr whole_file_region = get_parent(); if (whole_file_region) { diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index f7f5ef7e8d..da147fc2d4 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -2524,7 +2524,7 @@ Session::find_whole_file_parent (boost::shared_ptr child) } } - return boost::shared_ptr ((AudioRegion*) 0); + return boost::shared_ptr (); } void -- cgit v1.2.3