Subject: | suggest hook to initiate destroy |
Date: | Mon, 19 Jan 2009 07:58:51 +1100 |
To: | bug-Test-Weaken [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
With perl-gtk2 windows, ie. top-level app windows, it's necessary to
call $w->destroy, otherwise the object lives forever. (Gtk "helps" you
by not demanding you keep a ref to a toplevel.)
It'd be nice if Test::Weaken::poof had a hook of some kind so after it
digs around in created object(s) that you get a chance to perform extra
actions to ensure destruction. Maybe along the lines of
poof (sub { return Gtk2::Window->new('toplevel') },
destroy => sub { $_[0]->destroy });
with the destroy func just receiving whatever the creator returns (so
you could destroy on multiple objects, if you construct an array of
objects, or whatnot).
I think HTML::Tree has a similar explicit destructor thing, as
$tree->delete.