[Kde-perl] Memory fault when inserting QTableItem into QTable

Oliver Kreuer okreuer at PSI.de
Mon Aug 30 15:19:35 CEST 2004


Hello,

first of all I have to apologize that I couldn't spend time until now to 
test the patches provided by Richard.

I've tried patch perlqtdispose_0.2.patch (see thread "Freeing memory 
used by QTableItem) and it works fine in my testscripts. I didn't try 
patch perlqtdispose_0.3.patch because Richard wrote that he's going off 
the idea a bit.

So for me this patch (0.2) solves my problem. As far as I understood the 
  ongoing conversation after Richards 0.2er patch this patch isn't as 
"stable" as one could wish.
Therefore I wonder if there will be a "final" solution to this problem 
in a next or newer version of Perl/Qt?

Thanks for your help.
Oliver


Germain Garand wrote:
> Le Lundi 12 Juillet 2004 09:37, Ashley Winters a écrit :
> 
>>--- Richard Dale <Richard_Dale at tipitina.demon.co.uk> wrote:
>>
>>>On Monday 12 July 2004 03:03, Ashley Winters wrote:
>>>
>>>>--- Richard Dale <Richard_Dale at tipitina.demon.co.uk> wrote:
>>>>It's explicitly taking responsibility for the destruction of the
>>>
>>>object
>>>
>>>
>>>>AWAY from Perl by calling takeItem(), and we need to honor it.
>>>>
>>>>So, the patch is a simple one-line fix:
>>>>
>>>>-     setAllocated( $_[0], 1 );
>>>>+     setAllocated( $_[0], was_called_from_perl() );
>>>>
>>>>Of course, someone has to write was_called_from_perl(), which needs
> 
> 
> it looks to me that callMethod is the sensible place to do that 
> (i.e. set a flag).
> We know when the virtual call is issued, and we know when it goes back.
> 
> 
>>Unfortunately, this raises one more issue...
>>
>>$item = $object->findItemCreatedByQt();
>>$object->takeItem($item);
>>
>>$item is scheduled for deletion, but it's not in the global object map.
>>This contradicts the general rule that Perl is forbidden to delete
>>objects which aren't "owned" by the object map.
>>
> 
> 
> I think they are added to the object map upon marshalling, so that would be 
> all fine.
> 
> Germain, zombie too.
> _______________________________________________
> Kde-perl mailing list
> Kde-perl at kde.org
> https://mail.kde.org/mailman/listinfo/kde-perl



More information about the Kde-perl mailing list