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

Possible garbage collector bug

    XMLWordPrintable

Details

    • 7e1505439 (dev), 0c8941aaf (6.8), fa7a25418 (tqtc/lts-6.5)

    Description

      The following accesses a destroyed object in the second iteration, but I haven't managed to make it crash yet:

      import QtQml
       
      QtObject {
          id: root
          property int sum: 0
          Component.onCompleted: {
              try {
                  const handler = {};
                  let target = {prop1: 1, prop2: 2, prop3: 3 };
       
                  let proxy = Proxy.revocable(target, handler);
                  target = null;
                  for (var prop in proxy.proxy) {
                      root.sum += 5 - prop[4]
                      console.log(root.sum, prop);
                      proxy.revoke()
                      gc()
                  }
              } catch (e) {
                  console.log(e);
              }
              Qt.quit();
          }
      }
      

      Attachments

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

        Activity

          People

            diseraluca Luca Di Sera
            ulherman Ulf Hermann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes