[Kde-perl] Freeing memory used by QTableItem

Richard Dale Richard_Dale at tipitina.demon.co.uk
Fri Jul 9 09:52:41 CEST 2004


Actually that patch doesn't work I'm afraid. Here's another one, but it still 
isn't right. This works:

my $junk = Qt::PushButton("Hello World!", undef);
Qt::dispose($junk);

But what I was really trying to do was this:

my $junk = Qt::PushButton("Hello World!", undef);
$junk->dispose();

I can't work out how to do that..

-- Richard


On Friday 09 July 2004 04:48, Richard Dale wrote:
> I recently had a similar problem with the qtruby bindings ( which are based
> on the perlqt code), and I solved it be adding 'dispose()' and
> 'isDisposed()' methods. Please find attach a patch for PerlQt 3.008 which
> adds the same methods.
>
> $ cp perlqtdispose.patch PerlQt-3.008/PerlQt
> $ cd PerlQt-3.008/PerlQt
> $ patch Qt.xs -p0 < perlqtdispose.patch
>
> Then make and install PerlQt..
>
> -- Richard
>
> On Monday 05 July 2004 14:51, Oliver Kreuer wrote:
> > Hello,
> >
> > how can I free memory used by an object of class Qt::TableItem myself?
> > I've read that takeItem only removes an item from an existing table
> > without destroying the Qt::TableItem object.
> > So since I can't simply say "delete <object>" in Perl I tried the
> > following:
> >
> > my @t = ();
> > for (my $i=0 ;$i<1000 ;$i++ )
> > {
> >       $t[$i] = Qt::TableItem(table,&Qt::TableItem::Never,"$i");
> > }
> >
> > sleep(10);
> >
> > for (my $i=0 ;$i<1000 ;$i++ )
> > {
> >     $t[$i] = "";
> > }
> >
> > But "top" shows me that memory usage after the last loop increases
> > instead of decreases.
> >
> > Thanks for your help,
> > Oliver
> >
> >
> > _______________________________________________
> > Kde-perl mailing list
> > Kde-perl at kde.org
> > https://mail.kde.org/mailman/listinfo/kde-perl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: perlqtdispose_0.1.patch
Type: text/x-diff
Size: 1535 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-perl/attachments/20040709/c61af458/perlqtdispose_0.1.bin


More information about the Kde-perl mailing list