summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2005-10-04 02:21:06 +0000
committerDaniel Burrows <dburrows@debian.org>2005-10-04 02:21:06 +0000
commit8d7124efa07df7341bc8d62eb884aa3cc5d21c66 (patch)
tree01034cc11723ed94c23111cc389291215280152c
parentdc3b44fc1afec0f388db78c8b48200a539de5b89 (diff)
downloadaptitude-8d7124efa07df7341bc8d62eb884aa3cc5d21c66.tar.gz
[aptitude @ Disallow (assert against) the creation of strong references to widgets with a zero reference count.]
Since widgets are now created with a reference count of 1, it is now an invariant that every widget with a zero reference count is dead.
-rw-r--r--src/vscreen/vscreen_widget.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vscreen/vscreen_widget.h b/src/vscreen/vscreen_widget.h
index 6dac4280..22e79041 100644
--- a/src/vscreen/vscreen_widget.h
+++ b/src/vscreen/vscreen_widget.h
@@ -179,6 +179,8 @@ protected:
public:
void incref()
{
+ assert(refcount > 0);
+
++refcount;
}