Changeset 651 for trunk/src/script/bridge/qscriptqobject.cpp
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/script/bridge/qscriptqobject.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 979 979 Q_ASSERT(delegate && (delegate->type() == QScriptObjectDelegate::QtObject)); 980 980 QObject *qobj = static_cast<QScript::QObjectDelegate*>(delegate)->value(); 981 Q_ASSERT_X(qobj != 0, "QtFunction::call", "handle the case when QObject has been deleted"); 981 if (!qobj) 982 return JSC::throwError(exec, JSC::GeneralError, QString::fromLatin1("cannot call function of deleted QObject")); 982 983 QScriptEnginePrivate *engine = scriptEngineFromExec(exec); 983 984 … … 2220 2221 2221 2222 if (exec->hadException()) { 2222 engine->emitSignalHandlerException(); 2223 if (slot.inherits(&QtFunction::info) && !static_cast<QtFunction*>(JSC::asObject(slot))->qobject()) { 2224 // The function threw an error because the target QObject has been deleted. 2225 // The connections list is stale; remove the signal handler and ignore the exception. 2226 removeSignalHandler(sender(), signalIndex, receiver, slot); 2227 exec->clearException(); 2228 } else { 2229 engine->emitSignalHandlerException(); 2230 } 2223 2231 } 2224 2232 }
Note:
See TracChangeset
for help on using the changeset viewer.