aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/localstorage
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-11 14:36:01 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-18 13:13:21 +0200
commit002e6105f61269f1474de878ccdb26205e5b226e (patch)
treeead1d10b7d8aa2537e7073327d9d0d9ce591c995 /src/imports/localstorage
parent1a2a83f80ba4ecc28eba72af57c81bd43a45946c (diff)
Require a ValueScope for ScopedCallData as well
This brings things more in line with ScopedValue, and also simplifies cleanup of Scoped values. Change-Id: If5f1466b4e13c629d56c1e7c638937f61ba48f77 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/imports/localstorage')
-rw-r--r--src/imports/localstorage/plugin.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index 6aef93771d..f485032a35 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -315,6 +315,8 @@ static Value qmlsqldatabase_changeVersion(SimpleCallContext *ctx)
if (ctx->argumentCount < 2)
return Value::undefinedValue();
+ ValueScope scope(ctx);
+
QQmlSqlDatabaseWrapper *r = ctx->thisObject.as<QQmlSqlDatabaseWrapper>();
if (!r || r->type != QQmlSqlDatabaseWrapper::Database)
V4THROW_REFERENCE("Not a SQLDatabase object");
@@ -341,7 +343,7 @@ static Value qmlsqldatabase_changeVersion(SimpleCallContext *ctx)
ok = false;
db.transaction();
- ScopedCallData callData(ctx->engine, 1);
+ ScopedCallData callData(scope, 1);
callData->thisObject = engine->global();
callData->args[0] = Value::fromObject(w);
try {
@@ -377,6 +379,7 @@ static Value qmlsqldatabase_transaction_shared(SimpleCallContext *ctx, bool read
if (!r || r->type != QQmlSqlDatabaseWrapper::Database)
V4THROW_REFERENCE("Not a SQLDatabase object");
+ ValueScope scope(ctx);
QV8Engine *engine = ctx->engine->v8Engine;
FunctionObject *callback = ctx->argumentCount ? ctx->arguments[0].asFunctionObject() : 0;
@@ -395,7 +398,7 @@ static Value qmlsqldatabase_transaction_shared(SimpleCallContext *ctx, bool read
db.transaction();
if (callback) {
- ScopedCallData callData(ctx->engine, 1);
+ ScopedCallData callData(scope, 1);
callData->thisObject = engine->global();
callData->args[0] = Value::fromObject(w);
try {
@@ -678,7 +681,8 @@ void QQuickLocalStorage::openDatabaseSync(QQmlV4Function *args)
db->version = version;
if (created && dbcreationCallback) {
- ScopedCallData callData(ctx->engine, 1);
+ ValueScope scope(ctx);
+ ScopedCallData callData(scope, 1);
callData->thisObject = engine->global();
callData->args[0] = Value::fromObject(db);
dbcreationCallback->call(callData);