[Aptitude-svn-commit] r4150 - branches/aptitude-0.3/aptitude
Daniel Burrows
dburrows at costa.debian.org
Wed Sep 21 19:02:26 UTC 2005
Author: dburrows
Date: Wed Sep 21 19:02:26 2005
New Revision: 4150
Modified:
branches/aptitude-0.3/aptitude/README.SMART-POINTERS
Log:
Update smart pointer documentation.
Modified: branches/aptitude-0.3/aptitude/README.SMART-POINTERS
==============================================================================
--- branches/aptitude-0.3/aptitude/README.SMART-POINTERS (original)
+++ branches/aptitude-0.3/aptitude/README.SMART-POINTERS Wed Sep 21 19:02:26 2005
@@ -84,7 +84,10 @@
(ref_ptr.h). This is a templated class, like auto_ptr, and
generally works as you expect. To enforce the use of ref_ptr,
all widget constructors are protected; static ::create methods
- are provided to actually allocate a new widget.
+ are provided to actually allocate a new widget. Because the
+ vscreen_widget class initializes its reference count to 1, the
+ ::create method should explicitly decref() its return value; see
+ the existing ::create routines for examples.
To make code a bit more readable, adopt the convention of
creating typedefs for ref_ptr wrappers around new classes. For
@@ -101,8 +104,7 @@
Doing so will prevent "this" from being deleted until the
current method terminates and is probably good practice in
- general. However, you can get away without it if you know that
- you are being called via a ref_ptr.
+ general.
- Beware sigc::bind. sigc::bind is an easy way to create bad
circularities; moreover, it's actually unsafe to bind a ref_ptr
More information about the Aptitude-svn-commit
mailing list