<div dir="ltr">Oh, that sounds a be weird... We should also think about backward-compatibility now.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 20, 2024 at 2:44 PM Halla Rempt <<a href="mailto:halla@valdyas.org">halla@valdyas.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
I'm trying to fix an issue I created myself years ago (<a href="https://bugs.kde.org/show_bug.cgi?id=495802" rel="noreferrer" target="_blank">https://bugs.kde.org/show_bug.cgi?id=495802</a>), but I'm currently stumped...<br>
<br>
I've written a small C++ library to provide a simplified API to make scripting in Krita possible.<br>
<br>
In several places, I create a QList<SomeObject*> and return that, like:<br>
<br>
header:<br>
<br>
QList<Document*> documents() const;<br>
<br>
cpp:<br>
<br>
QList<Document *> Krita::documents() const<br>
{<br>
QList<Document *> ret;<br>
foreach(QPointer<KisDocument> doc, KisPart::instance()->documents()) {<br>
ret << new Document(doc, false);<br>
}<br>
return ret;<br>
}<br>
<br>
<br>
Document.sip<br>
<br>
QList<Document *> documents() const /Factory/;<br>
<br>
Now the Document* objects apparently aren't deleted when the list go out of scope. I thought the /Factory/ annotation would take care of that...<br>
<br>
Is there a generally "right" way of handling this situation?<br>
<br>
Thanks,<br>
<br>
Halla<br>
<br>
<br>
</blockquote></div><div><br clear="all"></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Dmitry Kazakov</div>