[PyQt] [BUG] QQmlComponent.create() marks item owner as C++ and they never garbage collected

Vladimir Rutsky rutsky.vladimir at gmail.com
Fri Jun 5 12:09:08 BST 2015


On Fri, Jun 5, 2015 at 1:35 PM, Phil Thompson
<phil at riverbankcomputing.com> wrote:
> On 04/06/2015 3:28 pm, Vladimir Rutsky wrote:
>>
>> Hello,
>>
>> QQuickItem's objects created with QQmlComponent.create() are owned by
>> C++, so when Python variable is being garbage collected item is not
>> destroyed.
>>
>> As workaroud I can manually call "sip.transferback(item)" for item -
>> after this item is properly garbage collected.
>>
>> I prepared complete example to reproduce this bug:
>> https://gist.github.com/rutsky/31f6cfb15c6aa474317a
>
>
> Should be fixed in tonight's snapshot.

Thanks, Phil!

>
> Any chance you can put together a similar script that demonstrates the
> problem you reported with createShader()?

I'm working on examples for all recently reported by me bugs, but doesn't
have enough time right now, so can't promise anything.


Regards,

Vladimir Rutsky


More information about the PyQt mailing list