Details
Description
QScriptEngine's garbage collection appears to not delete C++ objects wrapped as QScriptValues by a call to QScriptEngine::newQObject(), when QScriptEngine::AutoOwnership or ScriptOwnership are used.
The attached example (QtScriptGCBugReport.tar.gz) executes a script that repeatedly instantiates C++ objects of type A. It then attempts garbage collection both from a call in the script to gc() when those objects have gone out of scope, and through a direct call to QScriptEngine::collectGarbage() after the script execution is complete. However, the first time an instance of A is destructed is when the QScriptEngine is destructed.
Attachments
For Gerrit Dashboard: QTBUG-21993 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
29633,4 | Ensure QObject wrappers are garbage-collected if appropriate | master | qt/qtscript | Status: MERGED | +2 | 0 |