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

memory leak while calling a c++ object methode with boolean return type in javascript

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.7.0
    • None
    • Windows 7 / 10 with VS2015 Qt 5.7.0 32-Bit on a 64-Bit machine

    Description

      Executing a simple QML-Script with the QmlEngine like this:

      import QtQml 2.2
      import "file:///E:/Dev/Qt-Test/JavaScriptMemoryLeak/Testskript/MemoryLeak.js" as SPS_Script
      QtObject

      { id: root; property var scriptReturn: SPS_Script.main() }

      where the java script function "main()" ist defined as:

      function main()
      {
      var counter = 0;
      var isExit = false;
      while(!isExit)

      { isExit = exitController.oIsExitRequest(); // no memory leak if this line is removed counter++; }

      return "done: counter = " + counter;
      }

      cause a memory leak while calling a c++ object methode "bool oIsExitRequest() const".
      The c++ object is handed over with
      "mEnginePtr->rootContext()->setContextProperty("exitController", &mExitController);".
      The memory leak increases with each call of "oIsExitRequest()".
      Manually triggering the garbage collector has no effect.
      The attached VS2015 Project shows the memory leak in action.

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            hvdus h Dussel
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes