Mon Dec 03 16:48:46 2012: Request 81670 was acted upon. Transaction: Ticket created by use...@zip.com.au Queue: Wx Subject: Wx::Frame weaken away when ->Close() Broken in: (no value) Severity: (no value) Owner: Nobody Requestors: use...@zip.com.au Status: new Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=81670 >
Under a gtk build, a Wx::Frame $frame->Close seems to be enough to make the $frame object weaken away. The program foo.pl below prints "undef". Under mswin it looks like that might not be so. Ie. the foo.pl would print a Wx::Frame object, not undef. Alas I don't have an mswin to try, so this is just based on cpantesters failures I had in a pod browser main window. Is a $frame->Close meant to be enough for the object to weaken away? Or have I misunderstood Close() vs Destroy() methods?
use 5.008; use strict; use warnings; use Scalar::Util; use Wx; my $app = Wx::SimpleApp->new; my $frame = Wx::Frame->new; $frame->Show; $frame->Close; $app->Yield; Scalar::Util::weaken ($frame); print $frame||'undef',"\n";