summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1768099)
raw | patch | inline | side by side (parent: 1768099)
author | mental <mental@users.sourceforge.net> | |
Sun, 1 Jul 2007 20:08:45 +0000 (20:08 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Sun, 1 Jul 2007 20:08:45 +0000 (20:08 +0000) |
now, manual management for Subtree
src/xml/subtree.cpp | patch | blob | history | |
src/xml/subtree.h | patch | blob | history |
diff --git a/src/xml/subtree.cpp b/src/xml/subtree.cpp
index 7c549e7d738e297d982fdd59b70c6f9035672740..f19bf055afb401db67e85d3248ec6888f4037cae 100644 (file)
--- a/src/xml/subtree.cpp
+++ b/src/xml/subtree.cpp
}
-Subtree::Subtree(Node &root) : _root(&root) {
- recursively(&Node::addObserver, *_root, *this);
+Subtree::Subtree(Node &root) : _root(root) {
+ recursively(&Node::addObserver, _root, *this);
}
Subtree::~Subtree() {
- finish();
-}
-
-void Subtree::finish() {
- if (_root) {
- recursively(&Node::removeObserver, *_root, *this);
- _root = NULL;
- }
+ recursively(&Node::removeObserver, _root, *this);
}
void Subtree::synthesizeEvents(NodeObserver &observer) {
- if (_root) {
- recursively(&Node::synthesizeEvents, *_root, *this);
- }
+ recursively(&Node::synthesizeEvents, _root, *this);
}
void Subtree::addObserver(NodeObserver &observer) {
diff --git a/src/xml/subtree.h b/src/xml/subtree.h
index 73a6485d1eb641f20de7707bb558e31ed4119e8b..a70598fca6cc07343920c29a8da1c3774133614f 100644 (file)
--- a/src/xml/subtree.h
+++ b/src/xml/subtree.h
#include "xml/node-observer.h"
#include "xml/composite-node-observer.h"
+#include "gc-finalized.h"
namespace Inkscape {
namespace XML {
class Node;
-class Subtree : public Inkscape::GC::Anchored,
- public Inkscape::GC::Managed<>,
+class Subtree : public GC::Managed<GC::SCANNED, GC::MANUAL>,
private NodeObserver
{
public:
Subtree(Node &root);
~Subtree();
- void finish();
-
void synthesizeEvents(NodeObserver &observer);
void addObserver(NodeObserver &observer);
void removeObserver(NodeObserver &observer);
Util::ptr_shared<char> old_value,
Util::ptr_shared<char> new_value);
- Node *_root;
+ Node &_root;
CompositeNodeObserver _observers;
};