mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Explicitly delete QML context before releasing engine
This commit is contained in:
parent
6640313256
commit
1b612d373f
1 changed files with 8 additions and 7 deletions
|
@ -97,12 +97,13 @@ SharedObject::~SharedObject() {
|
|||
}
|
||||
|
||||
// _rootItem is parented to the quickWindow, so needs no explicit destruction
|
||||
//if (_rootItem) {
|
||||
// delete _rootItem;
|
||||
// _rootItem = nullptr;
|
||||
//}
|
||||
|
||||
releaseEngine(_qmlContext->engine());
|
||||
if (_qmlContext) {
|
||||
auto engine = _qmlContext->engine();
|
||||
delete _qmlContext;
|
||||
_qmlContext = nullptr;
|
||||
releaseEngine(engine);
|
||||
}
|
||||
}
|
||||
|
||||
void SharedObject::create(OffscreenSurface* surface) {
|
||||
|
@ -210,9 +211,9 @@ QQmlEngine* SharedObject::acquireEngine(OffscreenSurface* surface) {
|
|||
if (!globalEngine) {
|
||||
Q_ASSERT(0 == globalEngineRefCount);
|
||||
globalEngine = new QQmlEngine();
|
||||
surface->initializeQmlEngine(result);
|
||||
++globalEngineRefCount;
|
||||
surface->initializeEngine(result);
|
||||
}
|
||||
++globalEngineRefCount;
|
||||
result = globalEngine;
|
||||
#else
|
||||
result = new QQmlEngine();
|
||||
|
|
Loading…
Reference in a new issue