(PyQt 6.2.3) Creating a QQmlListProperty will cause access violation on application close (windows)

Phil Thompson phil at riverbankcomputing.com
Sat Feb 26 15:18:51 GMT 2022


On 11/02/2022 20:44, Jared Jones wrote:
> Hi everyone,
> 
> Recently I upgraded an Application in my organization from PyQt 5.5 to 
> PyQt
> 6.2.3. I noticed that after upgrading my application, it would cause a
> windows access violation everytime I closed my application. I 
> eventually
> tracked the issue down to the QQmlListProperty() objects in my program.
> When the application closes, the underlying QQmlListProperty() objects 
> (at
> the C++ level) do not seem to be deleted, which causes the access
> violation. When I removed all QQmlListProperty() objects, my program no
> longer throws an Access violation. Even when I have no 
> QQmlListProperty()
> objects in my program, if I drop into pdb, and create a basic
> QQmlListProperty() object using the syntax "QQmlListProperty(QObject,
> QObject(), [])", and do not assign this object to any python variable,
> simply continuing execution after doing this (and then ultimately 
> closing
> my app). will cause an access violation.
> 
> As of right now, there is no way around this bug, except for not using
> QQmlListProperty() entirely. QQmlListProperty() cannot be deleted with
> sip.delete(), so once the object is created, an access violation WILL
> happen when your application closes.There doesn't seem to be any way to
> delete an underlying QQmlListProperty() object
> 
> Hopefully, this issue can be resolved in a future release.

The next PyQt6 snapshot fixes a bug triggered by...

QQmlListProperty(QObject, QObject(), [])

...but the bug is also present in PyQt5 so is unlikely to be the 
underlying problem. A simple test script would help.

Phil


More information about the PyQt mailing list