destroy context when qquickview hidden
This commit is contained in:
@@ -100,6 +100,12 @@ void DoricJSEngine::prepareContext(QString contextId, QString script,
|
||||
mJSE->loadJS(packageContextScript(contextId, script), "Context://" + source);
|
||||
}
|
||||
|
||||
void DoricJSEngine::destroyContext(QString contextId) {
|
||||
QString script =
|
||||
QString(DoricConstant::TEMPLATE_CONTEXT_DESTROY).replace("%s", contextId);
|
||||
mJSE->loadJS(script, "_Context://" + contextId);
|
||||
}
|
||||
|
||||
void DoricJSEngine::invokeDoricMethod(QString method, QVariantList arguments) {
|
||||
return mJSE->invokeObject(DoricConstant::GLOBAL_DORIC, method, arguments);
|
||||
}
|
||||
|
@@ -25,7 +25,11 @@ public:
|
||||
~DoricJSEngine();
|
||||
|
||||
void prepareContext(QString contextId, QString script, QString source);
|
||||
|
||||
void destroyContext(QString contextId);
|
||||
|
||||
void invokeDoricMethod(QString method, QVariantList arguments);
|
||||
|
||||
DoricRegistry *getRegistry();
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user