Tweak deletion, emit CatchDeletion() only once

Parent class d'tor runs after derived class d'tor. By the time
~TimeAxisView() is called, the actual object has already been
deleted and dyanamic_cast<RouteTimeAxisView*> or
dynamic_cast<AutomationTimeAxisView*> will fail.

CatchDeletion() needs to be emitted from the actual d'tor of the object.

There are currently three non-virtual TAVs:
 * RouteTimeAxisView
 * AutomationTimeAxisView
 * VCATimeAxisView

The first two already directly emit CatchDeletion(), there's no need to
call it again from ~TimeAxisView().
This commit is contained in:
Robin Gareus 2019-08-24 18:42:51 +02:00
parent 7859340191
commit 1f05baa881
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 1 additions and 2 deletions

View File

@ -234,8 +234,6 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
TimeAxisView::~TimeAxisView()
{
CatchDeletion (this);
in_destructor = true;
for (list<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {

View File

@ -123,6 +123,7 @@ VCATimeAxisView::VCATimeAxisView (PublicEditor& ed, Session* s, ArdourCanvas::Ca
VCATimeAxisView::~VCATimeAxisView ()
{
delete automation_action_menu;
CatchDeletion (this);
}
void