|Subject:||Wx::Frame weaken away when ->Close()|
|Date:||Tue, 04 Dec 2012 08:48:58 +1100|
|From:||Kevin Ryde <email@example.com>|
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";