diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-02 14:45:16 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-02 14:45:16 (GMT) |
commit | 8abab5f61eb95192b7e3dcafab1980b35fd167bb (patch) | |
tree | 5f424ae3e6dd8c6908cafdc78b77588538f06991 | |
parent | 9543612b321c1b98e9e5ede2685ac0be3965fa3c (diff) | |
parent | c8b6b3f47e5e677f603b12af2fc6198697030ce2 (diff) | |
download | Qt-8abab5f61eb95192b7e3dcafab1980b35fd167bb.zip Qt-8abab5f61eb95192b7e3dcafab1980b35fd167bb.tar.gz Qt-8abab5f61eb95192b7e3dcafab1980b35fd167bb.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Use RefPtr to store QScriptProgram's EvalExecutable
-rw-r--r-- | src/gui/kernel/qt_cocoa_helpers_mac.mm | 2 | ||||
-rw-r--r-- | src/script/api/qscriptprogram.cpp | 9 | ||||
-rw-r--r-- | src/script/api/qscriptprogram_p.h | 4 |
3 files changed, 7 insertions, 8 deletions
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm index 39b3938..377e5a0 100644 --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm @@ -1281,7 +1281,6 @@ void qt_cocoaChangeOverrideCursor(const QCursor &cursor) } #endif - @implementation DebugNSApplication { } - (void)sendEvent:(NSEvent *)event @@ -1297,7 +1296,6 @@ void qt_cocoaChangeOverrideCursor(const QCursor &cursor) } @end - QMacCocoaAutoReleasePool::QMacCocoaAutoReleasePool() { #ifndef QT_MAC_USE_COCOA diff --git a/src/script/api/qscriptprogram.cpp b/src/script/api/qscriptprogram.cpp index c452052..d4a32f4 100644 --- a/src/script/api/qscriptprogram.cpp +++ b/src/script/api/qscriptprogram.cpp @@ -63,7 +63,6 @@ QScriptProgramPrivate::QScriptProgramPrivate(const QString &src, QScriptProgramPrivate::~QScriptProgramPrivate() { - delete _executable; } QScriptProgramPrivate *QScriptProgramPrivate::get(const QScriptProgram &q) @@ -76,17 +75,17 @@ JSC::EvalExecutable *QScriptProgramPrivate::executable(JSC::ExecState *exec, { if (_executable) { if (eng == engine) - return _executable; - delete _executable; + return _executable.get(); + _executable = 0; } WTF::PassRefPtr<QScript::UStringSourceProviderWithFeedback> provider = QScript::UStringSourceProviderWithFeedback::create(sourceCode, fileName, firstLineNumber, eng); sourceId = provider->asID(); JSC::SourceCode source(provider, firstLineNumber); //after construction of SourceCode provider variable will be null. - _executable = new JSC::EvalExecutable(exec, source); + _executable = JSC::EvalExecutable::create(exec, source); engine = eng; isCompiled = false; - return _executable; + return _executable.get(); } /*! diff --git a/src/script/api/qscriptprogram_p.h b/src/script/api/qscriptprogram_p.h index 427ab34..95e75fd 100644 --- a/src/script/api/qscriptprogram_p.h +++ b/src/script/api/qscriptprogram_p.h @@ -37,6 +37,8 @@ #include <QtCore/qobjectdefs.h> +#include "RefPtr.h" + namespace JSC { class EvalExecutable; @@ -67,7 +69,7 @@ public: int firstLineNumber; QScriptEnginePrivate *engine; - JSC::EvalExecutable *_executable; + WTF::RefPtr<JSC::EvalExecutable> _executable; intptr_t sourceId; bool isCompiled; }; |