mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 05:23:33 +02: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
|
// _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) {
|
void SharedObject::create(OffscreenSurface* surface) {
|
||||||
|
@ -210,9 +211,9 @@ QQmlEngine* SharedObject::acquireEngine(OffscreenSurface* surface) {
|
||||||
if (!globalEngine) {
|
if (!globalEngine) {
|
||||||
Q_ASSERT(0 == globalEngineRefCount);
|
Q_ASSERT(0 == globalEngineRefCount);
|
||||||
globalEngine = new QQmlEngine();
|
globalEngine = new QQmlEngine();
|
||||||
surface->initializeQmlEngine(result);
|
surface->initializeEngine(result);
|
||||||
++globalEngineRefCount;
|
|
||||||
}
|
}
|
||||||
|
++globalEngineRefCount;
|
||||||
result = globalEngine;
|
result = globalEngine;
|
||||||
#else
|
#else
|
||||||
result = new QQmlEngine();
|
result = new QQmlEngine();
|
||||||
|
|
Loading…
Reference in a new issue