aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-05-21 10:17:30 +0200
committerLars Knoll <lars.knoll@digia.com>2013-05-21 10:36:47 +0200
commit05346f300383b322049e75158c1ab5481bfc2c40 (patch)
treee810069cf9f1c2ac2c0a5458dd466ef21cf128c3 /src/imports
parent4d628bfca64cbbaf2904748d18f04dbc74545312 (diff)
Small exception handling fixes
* Don't accept the exception if we're going to re-throw it (partial unwind is not necessary as we don't have a stack-based context to clean up) * However do accept() it if we decided to handle it (in qqmlvme.cpp) Change-Id: I63bfa34f30fe19ad36de746b1f15fc6b641e563b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/localstorage/plugin.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index 7ce4f43b9d..998155d29a 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -343,11 +343,9 @@ static QV4::Value qmlsqldatabase_changeVersion(const v8::Arguments& args)
QV4::Value callbackArgs[] = { instance->v4Value() };
QV4::FunctionObject *f = callback->v4Value().asFunctionObject();
- QV4::ExecutionContext *ctx = f->engine()->current;
try {
f->call(engine->global(), callbackArgs, 1);
- } catch (QV4::Exception &e) {
- e.accept(ctx);
+ } catch (QV4::Exception &) {
db.rollback();
throw;
}
@@ -397,12 +395,10 @@ static QV4::Value qmlsqldatabase_transaction_shared(const v8::Arguments& args, b
db.transaction();
QV4::FunctionObject *f = callback->v4Value().asFunctionObject();
if (f) {
- QV4::ExecutionContext *ctx = f->engine()->current;
QV4::Value callbackArgs[] = { instance->v4Value() };
try {
f->call(engine->global(), callbackArgs, 1);
- } catch (QV4::Exception &e) {
- e.accept(ctx);
+ } catch (QV4::Exception &) {
q->inTransaction = false;
db.rollback();
throw;
@@ -684,14 +680,8 @@ void QQuickLocalStorage::openDatabaseSync(QQmlV4Function *args)
if (created) {
QV4::FunctionObject *f = dbcreationCallback->v4Value().asFunctionObject();
if (f) {
- QV4::ExecutionContext *ctx = f->engine()->current;
QV4::Value args[] = { instance->v4Value() };
- try {
- f->call(engine->global(), args, 1);
- } catch (QV4::Exception &e) {
- e.accept(ctx);
- throw;
- }
+ f->call(engine->global(), args, 1);
}
}