diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-10-25 20:11:42 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-10-25 20:11:42 +0000 |
commit | bcd511aa3fec59e1527c8b7ab80dabda4db1a6f9 (patch) | |
tree | 0e704409baaaa22a43b918adc126c76990208f5f /libs/pbd/pbd/memento_command.h | |
parent | 1b39adc4ce8566fd731cf433094b1faf4fe63205 (diff) |
fixes for endemic (compiler?) issues with virtual inheritance of sigc::trackable. NOTE: automation list undo/redo no longer operational, fix to follow
git-svn-id: svn://localhost/ardour2/trunk@1007 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pbd/memento_command.h')
-rw-r--r-- | libs/pbd/pbd/memento_command.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/libs/pbd/pbd/memento_command.h b/libs/pbd/pbd/memento_command.h index d42972d546..fe1aa8e7d0 100644 --- a/libs/pbd/pbd/memento_command.h +++ b/libs/pbd/pbd/memento_command.h @@ -28,19 +28,11 @@ using std::endl; #include <pbd/command.h> #include <pbd/stacktrace.h> #include <pbd/xml++.h> +#include <pbd/shiva.h> + #include <sigc++/slot.h> #include <typeinfo> -/* grrr, strict C++ says that static member functions are not C functions, but we also want - to be able to pack this into a sigc::ptr_fun and not sigc::mem_fun, so we have to make - it a genuine function rather than a member. -*/ - -static void object_death (Command* mc) { - cerr << "\n\n\n---> OBJECT DEATH FIRED FOR " << mc << endl; - delete mc; -} - /** This command class is initialized with before and after mementos * (from Stateful::get_state()), so undo becomes restoring the before * memento, and redo is restoring the after memento. @@ -55,8 +47,8 @@ class MementoCommand : public Command XMLNode *after ) : obj(object), before(before), after(after) { - cerr << "MC @ " << this << " is a " << typeid (obj_T).name() << endl; - obj.GoingAway.connect (sigc::bind (sigc::ptr_fun (object_death), static_cast<Command*>(this))); + /* catch destruction of the object */ + new PBD::Shiva<obj_T,MementoCommand<obj_T> > (object, *this); } ~MementoCommand () { |