Code

Use subdirectories with icon sizes.
[inkscape.git] / src / gc-anchored.h
index 214f26a70531fc1f9c86d69bd46b29f248040b3b..b15d11f5d0e31deb0952abaccf0b09f928f0330e 100644 (file)
@@ -3,8 +3,7 @@
  *
  * Authors:
  *   MenTaLguY <mental@rydia.net>
- *
- * Copyright (C) 2004 MenTaLguY
+ * * Copyright (C) 2004 MenTaLguY
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
@@ -50,22 +49,17 @@ namespace GC {
 
 class Anchored {
 public:
-    void anchor() const {
-        if (!_anchor) {
-            _anchor = _new_anchor();
-        }
-        _anchor->refcount++;
-    }
+    void anchor() const;
+    void release() const;
 
-    void release() const {
-        if (!--_anchor->refcount) {
-            _free_anchor(_anchor);
-            _anchor = NULL;
-        }
+    // for debugging
+    unsigned _anchored_refcount() const {
+        return ( _anchor ? _anchor->refcount : 0 );
     }
 
 protected:
     Anchored() : _anchor(NULL) { anchor(); } // initial refcount of one
+    virtual ~Anchored() {}
 
 private:
     struct Anchor : public Managed<SCANNED, MANUAL> {
@@ -182,4 +176,4 @@ static R *release(R *r) {
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :