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

View file

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

View file

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