Re: Gtk2::ImageView memory issue



Am Mittwoch, den 04.03.2009, 14:50 -0500 schrieb zentara:

You could try putting the following as a global in main:
my $selector    = Gtk2::ImageView::Tool::Selector->new( undef );


or possibly before you leave the sub: 
$selector->destroy;
undef $selector;


Yeah, I've already tried that. undef $selector does nothing and
Gtk2::ImageView::Tool::Selector does not have a destroy method.

I've also had good luck, with just declaring a global like this, 
to reuse it's scalar namespace.

# in main
  my $selector;  #global scalar space


Declaring it globally works, but i don't see the difference to other
variables here. Why are the newly created pixbufs not leaking when they
are created each time in the sub?

In fact there is now possibility to reuse Gtk2::ImageView in a module
and create several instances of it without leaking, am i right?

Cheers
Mario 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]