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

Re: Problem with global destruction



On Mon, 2007-03-19 at 19:17 +0200, Ari Jolma wrote:

> > Try overriding the destroy signal (NOT the DESTROY method, but the "destroy"
> > signal!!) on your ScrolledWindow subclass, and in there, disconnect the signal
> > and destroy the child.
> >   
> 
> Couldn't do that, the signal seems to connect (it returns an integer) 
> but does not get called (I tried signals "destroy" and "destroy_event"). 
> However, I can call the do_destroy (below) from the close subroutine of 
> the main window. But that does seem to help :(

if the destroy signal never gets called, it seems that the image never
gets destroyed.

try adding a FINALIZE method in your Gtk2::ScrolledWindow subclass, and
explicitely remove the image:

  sub FINALIZE {
    my ($self) = @_;

    warn "Inside finalize\n";

    $self->remove($self->{image});
    delete $self->{image}; # this should not be needed
  }

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,  E: ebassi gmail com
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




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