summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qpropertyprivate.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qpropertyprivate.h')
-rw-r--r--src/corelib/kernel/qpropertyprivate.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/kernel/qpropertyprivate.h b/src/corelib/kernel/qpropertyprivate.h
index 91d9e56d2f..10bf4ca828 100644
--- a/src/corelib/kernel/qpropertyprivate.h
+++ b/src/corelib/kernel/qpropertyprivate.h
@@ -85,7 +85,12 @@ public:
T *take() noexcept { T *x = d; d = nullptr; return x; }
QPropertyBindingPrivatePtr() noexcept : d(nullptr) { }
- Q_CORE_EXPORT ~QPropertyBindingPrivatePtr();
+ ~QPropertyBindingPrivatePtr()
+ {
+ if (d && (--d->ref == 0))
+ destroyAndFreeMemory();
+ }
+ Q_CORE_EXPORT void destroyAndFreeMemory();
explicit QPropertyBindingPrivatePtr(T *data) noexcept : d(data) { if (d) d->addRef(); }
QPropertyBindingPrivatePtr(const QPropertyBindingPrivatePtr &o) noexcept