Commit 4bd1fad0 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵

models returned by ViewManager will be deleted by QQmlEngine

sets explicitly QQmlEngine::JavaScriptOwnership for models created by
ViewManager and returned to qml

once they are no longer referenced by qml, they will be automatically
deleted
parent 86374726
......@@ -16,6 +16,8 @@
#include <KI18n/KLocalizedString>
#include <QQmlEngine>
class ViewManagerPrivate
{
public:
......@@ -229,6 +231,9 @@ void ViewManager::openViewFromData(const ViewParameters &viewParamaters)
break;
}
QQmlEngine::setObjectOwnership(newModel, QQmlEngine::JavaScriptOwnership);
QQmlEngine::setObjectOwnership(proxyModel, QQmlEngine::JavaScriptOwnership);
d->mViewParametersStack.push_back(viewParamaters);
switch (viewParamaters.mViewPresentationType)
{
......
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