Kaydet (Commit) a6e5ac3b authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Meeks

vclwidget: add some safety net asserts

Change-Id: I5fa19ec6161ab97eb7df8b52a268917f41ae2205
üst 489a4fb3
......@@ -274,11 +274,13 @@ private:
inline void acquire() const
{
assert(!mbDisposed);
mnRefCnt++;
}
inline void release() const
{
assert(mnRefCnt>0);
if (!--mnRefCnt)
delete const_cast<OutputDevice*>(this);
}
......
......@@ -270,6 +270,7 @@ public:
~ScopedVclPtr()
{
VclPtr<reference_type>::disposeAndClear();
assert(VclPtr<reference_type>::get() == nullptr); // make sure there are no lingering references
}
private:
// Most likely we don't want this default copy-construtor.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment