diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-10-10 19:51:35 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-10-10 19:51:35 +0000 |
commit | b94f199970e442b9fc8ae87702babf21677692ec (patch) | |
tree | 13050911f994aaf330fa18fb698a59db05dba5f0 /libs | |
parent | 5a545c3c275473f10d42f129de03b005499cc582 (diff) |
add control port to ardour.rc.in and fix crash bug caused by bad shared_ptr<Region>(this) construct, seen when invoking "Original Position" from region context menu
git-svn-id: svn://localhost/ardour2/trunk@973 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/audioregion.cc | 7 | ||||
-rw-r--r-- | libs/ardour/region.cc | 2 | ||||
-rw-r--r-- | libs/ardour/session.cc | 2 |
3 files changed, 8 insertions, 3 deletions
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<Region> r; if (_playlist) { - r = _playlist->session().find_whole_file_parent (boost::shared_ptr<AudioRegion>(this)); + boost::shared_ptr<AudioRegion> ar; + boost::shared_ptr<AudioRegion> grrr2 = boost::dynamic_pointer_cast<AudioRegion> (shared_from_this()); + + if (grrr2 && (ar = _playlist->session().find_whole_file_parent (grrr2))) { + return boost::static_pointer_cast<Region> (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<Region> 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<AudioRegion> child) } } - return boost::shared_ptr<AudioRegion> ((AudioRegion*) 0); + return boost::shared_ptr<AudioRegion> (); } void |