aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlmodels/qquickpackage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmlmodels/qquickpackage.cpp')
-rw-r--r--src/qmlmodels/qquickpackage.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qmlmodels/qquickpackage.cpp b/src/qmlmodels/qquickpackage.cpp
index bf83afb329..999919562b 100644
--- a/src/qmlmodels/qquickpackage.cpp
+++ b/src/qmlmodels/qquickpackage.cpp
@@ -90,11 +90,14 @@ public:
struct DataGuard : public QQmlGuard<QObject>
{
- DataGuard(QObject *obj, QList<DataGuard> *l) : list(l) { (QQmlGuard<QObject>&)*this = obj; }
+ DataGuard(QObject *obj, QList<DataGuard> *l) : QQmlGuard<QObject>(DataGuard::objectDestroyedImpl, nullptr), list(l) { (QQmlGuard<QObject>&)*this = obj; }
QList<DataGuard> *list;
- void objectDestroyed(QObject *) override {
+
+ private:
+ static void objectDestroyedImpl(QQmlGuardImpl *guard) {
+ auto This = static_cast<DataGuard *>(guard);
// we assume priv will always be destroyed after objectDestroyed calls
- list->removeOne(*this);
+ This->list->removeOne(*This);
}
};