From 75c9d8705155d522eb03dd7ba7138c997995cc62 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 15 Jul 2010 00:25:58 +0000 Subject: [PATCH] Fix thinko in my previous commit. Should fix #3315. git-svn-id: svn://localhost/ardour2/branches/3.0@7421 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/pbd/pbd/memento_command.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/pbd/pbd/memento_command.h b/libs/pbd/pbd/memento_command.h index a46aea0002..8b412937ef 100644 --- a/libs/pbd/pbd/memento_command.h +++ b/libs/pbd/pbd/memento_command.h @@ -73,6 +73,7 @@ public: } void object_died () { + /* The object we are binding died, so drop references to ourselves */ this->drop_references (); } @@ -92,13 +93,15 @@ public: MementoCommand (obj_T& a_object, XMLNode* a_before, XMLNode* a_after) : _binder (new SimpleMementoCommandBinder (a_object)), before (a_before), after (a_after) { - _binder->Destroyed.connect_same_thread (_binder_death_connection, boost::bind (&MementoCommand::binder_died, this)); + /* The binder's object died, so we must die */ + _binder->DropReferences.connect_same_thread (_binder_death_connection, boost::bind (&MementoCommand::binder_dying, this)); } MementoCommand (MementoCommandBinder* b, XMLNode* a_before, XMLNode* a_after) : _binder (b), before (a_before), after (a_after) { - _binder->Destroyed.connect_same_thread (_binder_death_connection, boost::bind (&MementoCommand::binder_died, this)); + /* The binder's object died, so we must die */ + _binder->DropReferences.connect_same_thread (_binder_death_connection, boost::bind (&MementoCommand::binder_dying, this)); } ~MementoCommand () { @@ -108,7 +111,7 @@ public: delete _binder; } - void binder_died () { + void binder_dying () { delete this; }