Changeset 846 for trunk/src/script/api/qscriptprogram.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/script/api/qscriptprogram.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 33 33 34 34 /*! 35 \internal 36 37 \since 4.6 35 \since 4.7 38 36 \class QScriptProgram 39 37 … … 64 62 QScriptProgramPrivate::~QScriptProgramPrivate() 65 63 { 66 delete _executable; 64 if (engine) { 65 QScript::APIShim shim(engine); 66 _executable.clear(); 67 engine->unregisterScriptProgram(this); 68 } 67 69 } 68 70 … … 77 79 if (_executable) { 78 80 if (eng == engine) 79 return _executable; 80 delete _executable; 81 return _executable.get(); 82 // "Migrating" to another engine; clean up old state 83 QScript::APIShim shim(engine); 84 _executable.clear(); 85 engine->unregisterScriptProgram(this); 81 86 } 82 87 WTF::PassRefPtr<QScript::UStringSourceProviderWithFeedback> provider … … 84 89 sourceId = provider->asID(); 85 90 JSC::SourceCode source(provider, firstLineNumber); //after construction of SourceCode provider variable will be null. 86 _executable = new JSC::EvalExecutable(exec, source);91 _executable = JSC::EvalExecutable::create(exec, source); 87 92 engine = eng; 93 engine->registerScriptProgram(this); 88 94 isCompiled = false; 89 return _executable; 95 return _executable.get(); 96 } 97 98 void QScriptProgramPrivate::detachFromEngine() 99 { 100 _executable.clear(); 101 sourceId = -1; 102 isCompiled = false; 103 engine = 0; 90 104 } 91 105 … … 122 136 QScriptProgram::~QScriptProgram() 123 137 { 124 Q_D(QScriptProgram);125 // if (d->engine && (d->ref == 1))126 // d->engine->unregisterScriptProgram(d);127 138 } 128 139 … … 132 143 QScriptProgram &QScriptProgram::operator=(const QScriptProgram &other) 133 144 { 134 // if (d_func() && d_func()->engine && (d_func()->ref == 1))135 // d_func()->engine->unregisterScriptProgram(d_func());136 // }137 145 d_ptr = other.d_ptr; 138 146 return *this;
Note:
See TracChangeset
for help on using the changeset viewer.