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: ...@@ -274,11 +274,13 @@ private:
inline void acquire() const inline void acquire() const
{ {
assert(!mbDisposed);
mnRefCnt++; mnRefCnt++;
} }
inline void release() const inline void release() const
{ {
assert(mnRefCnt>0);
if (!--mnRefCnt) if (!--mnRefCnt)
delete const_cast<OutputDevice*>(this); delete const_cast<OutputDevice*>(this);
} }
......
...@@ -270,6 +270,7 @@ public: ...@@ -270,6 +270,7 @@ public:
~ScopedVclPtr() ~ScopedVclPtr()
{ {
VclPtr<reference_type>::disposeAndClear(); VclPtr<reference_type>::disposeAndClear();
assert(VclPtr<reference_type>::get() == nullptr); // make sure there are no lingering references
} }
private: private:
// Most likely we don't want this default copy-construtor. // 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