Free memory after closing the preview and the setting windows

This commit is contained in:
Alessandro Ranellucci 2013-11-12 21:49:34 +01:00
parent 2c416cc4ac
commit 4be1e5702a
3 changed files with 8 additions and 5 deletions

View file

@ -4,7 +4,7 @@ use warnings;
use utf8;
use Wx qw(:dialog :id :misc :sizer :systemsettings :notebook wxTAB_TRAVERSAL);
use Wx::Event qw(EVT_BUTTON);
use Wx::Event qw(EVT_CLOSE);
use base 'Wx::Dialog';
sub new {
@ -18,6 +18,12 @@ sub new {
$self->SetSizer($sizer);
$self->SetMinSize($self->GetSize);
# needed to actually free memory
EVT_CLOSE($self, sub {
$self->EndModal(wxID_OK);
$self->Destroy;
});
return $self;
}

View file

@ -29,6 +29,7 @@ sub new {
$self->{materials}->Closing;
$self->EndModal(wxID_OK);
$self->Destroy;
});
my $sizer = Wx::BoxSizer->new(wxVERTICAL);

View file

@ -323,10 +323,6 @@ sub Resize {
}
}
sub DESTROY {
my $self = shift;
}
sub InitGL {
my $self = shift;