Re: Memory fault when inserting QTableItem into QTable

Germain Garand <[email protected]>
Newsgroups gmane.comp.kde.devel.perl
Message-ID <[email protected]>
Le Lundi 12 Juillet 2004 09:37, Ashley Winters a écrit :
> --- Richard Dale <[email protected]> wrote:
> > On Monday 12 July 2004 03:03, Ashley Winters wrote:
> > > --- Richard Dale <[email protected]> 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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.