diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-24 13:53:54 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-26 09:05:22 +0200 |
commit | 0f204625dc6720d40df22ca352af995af5448525 (patch) | |
tree | edb78721935e2b0d34927b3dc358c3b171dc43b1 /src/quick/items/qquickdrag.cpp | |
parent | a57085f00b146798a0cca0d52dfa127232c3e659 (diff) |
Fix QQmlV4Function API to be GC safe
Change-Id: Id4f79c22fc48ada1c8a9a858e1b7b3d1cf14d120
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick/items/qquickdrag.cpp')
-rw-r--r-- | src/quick/items/qquickdrag.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index d66c57c667..fa8b52dfd9 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -595,9 +595,10 @@ void QQuickDragAttached::start(QQmlV4Function *args) Qt::DropActions supportedActions = d->supportedActions; // check arguments for supportedActions, maybe data? if (args->length() >= 1) { - QV4::Value v = (*args)[0]; - if (v.isInt32()) { - supportedActions = Qt::DropActions(v.integerValue()); + QV4::Scope scope(args->v4engine()); + QV4::ScopedValue v(scope, (*args)[0]); + if (v->isInt32()) { + supportedActions = Qt::DropActions(v->integerValue()); d->overrideActions = true; } } @@ -773,15 +774,16 @@ void QQuickDragAttached::startDrag(QQmlV4Function *args) // check arguments for supportedActions if (args->length() >= 1) { - QV4::Value v = (*args)[0]; - if (v.isInt32()) { - supportedActions = Qt::DropActions(v.integerValue()); + QV4::Scope scope(args->v4engine()); + QV4::ScopedValue v(scope, (*args)[0]); + if (v->isInt32()) { + supportedActions = Qt::DropActions(v->integerValue()); } } Qt::DropAction dropAction = d->startDrag(supportedActions); - args->setReturnValue(QV4::Value::fromInt32(dropAction)); + args->setReturnValue(QV4::Encode((int)dropAction)); } QQuickDrag::QQuickDrag(QObject *parent) |