diff options
author | Carl Hetherington <carl@carlh.net> | 2010-07-15 00:25:58 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-07-15 00:25:58 +0000 |
commit | 75c9d8705155d522eb03dd7ba7138c997995cc62 (patch) | |
tree | bdc6838146b259d7aa2a3c2160566407f882e6a6 /libs | |
parent | 2091f8453b523f7063371dcbd5fbe0ebc59efc01 (diff) |
Fix thinko in my previous commit. Should fix #3315.
git-svn-id: svn://localhost/ardour2/branches/3.0@7421 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/pbd/pbd/memento_command.h | 9 |
1 files 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<obj_T> (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<obj_T>* 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; } |