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

Probable bug: two wrappers can have the same C pointer address

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 1.2.x, dev
    • Fix Version/s: dev
    • Component/s: Shiboken
    • Labels:

      Description

      Two different C++ objects may have the same C pointer address. An example is QTextEdit.ExtraSelection which is a fairly simple struct whose first member is a cursor. With pyside / shiboken:

      from PySide2 import shiboken2 as shiboken
      from PySide2.QtWidgets import *
      extra = QTextEdit.ExtraSelection()
      cursor = extra.cursor
      print(shiboken.getCppPointer(extra))
      print(shiboken.getCppPointer(cursor))
      

      Both will have the same address. The probable bug is that both are registered in binding manager's wrapperMapper and code looking up one or the other may get the wrong wrapper. I found this when I inserted local changes to ensure two wrappers aren't inserted in the wrapperaMapper; I don't know of an observable bug caused by this.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              kleint Friedemann Kleint
              Reporter:
              jpe John Ehresman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes