Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1585

Null-QVariant None not incremented

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2
    • PySide
    • None
    • Custom bindings, generated with Shiboken2
      Used in embedded python application
    • Linux/X11

    Description

      A C++-Function that returns a Null-QVariant produces intentionally a None-Object.
      This works just fine. But the None-PyObject seems not to be IncRefed.

      In the end this leads to application chrashes of course, when the assiged variable is released again.

       

      I could reproduce the misbehaviour with the following minimal example of a C++ function for that I built a binding.

      QVariant myFunc() {
        QVariant var;
        var.setValue(nullptr);
        return var;
      }
      

      To faster provoke a crash from that I also tried something like this (that also led to a crash):

      QVariant myFunc() {
        var.setValue(nullptr);
        QVariantList list;
        for (int i=0; i<10000; ++i) {
          list.append(var);
        }
        return list;
      }
      

      I tried this in our embedded python implementation but I am pretty sure that this issue is primarily related to the binding itself.

      Both examples listed above led to a continously decreasing ref count of the _Py_NoneStruct PyObject.

      Attachments

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

        Activity

          People

            kleint Friedemann Kleint
            uewiebelitz Uriel Elias Wiebelitz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes