Code

switched UndoStackObserver / CompositeUndoStackObserver to use GC
authordwyip <dwyip@users.sourceforge.net>
Tue, 4 Jul 2006 20:35:26 +0000 (20:35 +0000)
committerdwyip <dwyip@users.sourceforge.net>
Tue, 4 Jul 2006 20:35:26 +0000 (20:35 +0000)
managed memory.  Initial tests seem to check out okay

src/composite-undo-stack-observer.h
src/undo-stack-observer.h

index 02d54eb7693415fc361ba199f18abc1cddbf4e0a..7b6b693b64848b4f58a0a692efc78fc81e3cece2 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef __COMPOSITE_UNDO_COMMIT_OBSERVER_H__
 #define __COMPOSITE_UNDO_COMMIT_OBSERVER_H__
 
+#include "gc-alloc.h"
+#include "gc-managed.h"
 #include "undo-stack-observer.h"
 
 #include <list>
@@ -32,7 +34,7 @@ public:
        /**
         * Structure for tracking UndoStackObservers.
         */
-       struct UndoStackObserverRecord {
+       struct UndoStackObserverRecord : public GC::Managed<> {
        public:
                /**
                 * Constructor.
@@ -88,7 +90,7 @@ public:
        };
 
        /// A list of UndoStackObserverRecords, used to aggregate multiple UndoStackObservers.
-       typedef std::list< UndoStackObserverRecord > UndoObserverRecordList;
+       typedef std::list< UndoStackObserverRecord, GC::Alloc< UndoStackObserverRecord, GC::MANUAL > > UndoObserverRecordList;
 
        /**
         * Constructor.
index cd17c467575ca2415c89d0fb8d5db2b78658c3fc..dbda2b9809e04f867224b3efaa16c5fe6415af53 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef __UNDO_COMMIT_OBSERVER_H__
 #define __UNDO_COMMIT_OBSERVER_H__
 
+#include "gc-managed.h"
+
 namespace Inkscape {
 
 class Event;
@@ -32,7 +34,7 @@ class Event;
  * UndoStackObservers should not be used on their own.  Instead, they should be registered
  * with a CompositeUndoStackObserver.
  */
-class UndoStackObserver {
+class UndoStackObserver : public GC::Managed<> {
 public:
        UndoStackObserver() { }
        virtual ~UndoStackObserver() { }