Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-21993

QScriptEngine::collectGarbage() does not delete C++ objects wrapped by QScriptEngine::newQObject()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.0.0
    • 4.7.4
    • Qt Script
    • None
    • Red Hat Enterprise Linux 5
      x86 64-bit
      gcc 4.1.2 20080704
    • 378416af7542e34196908896c9a69573b995adb0

    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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kenthans Kent Hansen (Inactive)
            danielbaker Daniel Baker
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes