summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cc7e339)
raw | patch | inline | side by side (parent: cc7e339)
author | mental <mental@users.sourceforge.net> | |
Sat, 29 Apr 2006 17:28:50 +0000 (17:28 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Sat, 29 Apr 2006 17:28:50 +0000 (17:28 +0000) |
doc/refcounting.txt | patch | blob | history |
diff --git a/doc/refcounting.txt b/doc/refcounting.txt
index 6ba506e4d1f4fa7d51a292ffd1e64342fe5124f1..bb8cc5d5183ca077e05d254bcf83fa8c2b0102c0 100644 (file)
--- a/doc/refcounting.txt
+++ b/doc/refcounting.txt
[ note: for code underneath the Inkscape namespace, you need only write
GC::anchor(), but in other code you will need to write
- Inkscape::GC::anchor(), or import the GC namespace with:
+ Inkscape::GC::anchor(), or import the GC namespace to your .cpp file
+ with:
namespace GC = Inkscape::GC;
This means that during the lifetime of an object, there should be N refs
and N+1 unrefs on it. If these become unbalanced, then you are likely to
-experience either transient crashing bugs (since the object could get freed
-while someone is still using it) or memory leaks (the object is forgotten
-while it still has a nonzero refcount, so it is never freed).
+experience either transient crashing bugs (the object gets freed while
+someone is still using it) or memory leaks (the object never gets freed).
As a rule, an object should be unreffed by the same class or compilation
unit that reffed it. Reffing or unreffing an object on someone else's behalf