Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2013-11-13 00:49:34 +0400
committerAlessandro Ranellucci <aar@cpan.org>2013-11-13 00:49:34 +0400
commit4be1e5702ad969d4ed4cd5ccc611f9de21940c1d (patch)
tree2bc4660ef45623e9fb8db0466e8767a76795b59e
parent2c416cc4ac50f4bcce55b530e176966e2ba644a3 (diff)
Free memory after closing the preview and the setting windows
-rw-r--r--lib/Slic3r/GUI/Plater/ObjectPreviewDialog.pm8
-rw-r--r--lib/Slic3r/GUI/Plater/ObjectSettingsDialog.pm1
-rw-r--r--lib/Slic3r/GUI/PreviewCanvas.pm4
3 files changed, 8 insertions, 5 deletions
diff --git a/lib/Slic3r/GUI/Plater/ObjectPreviewDialog.pm b/lib/Slic3r/GUI/Plater/ObjectPreviewDialog.pm
index fbcc5d776..671fe430b 100644
--- a/lib/Slic3r/GUI/Plater/ObjectPreviewDialog.pm
+++ b/lib/Slic3r/GUI/Plater/ObjectPreviewDialog.pm
@@ -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;
}
diff --git a/lib/Slic3r/GUI/Plater/ObjectSettingsDialog.pm b/lib/Slic3r/GUI/Plater/ObjectSettingsDialog.pm
index 6f8ef8ffe..cf559f57e 100644
--- a/lib/Slic3r/GUI/Plater/ObjectSettingsDialog.pm
+++ b/lib/Slic3r/GUI/Plater/ObjectSettingsDialog.pm
@@ -29,6 +29,7 @@ sub new {
$self->{materials}->Closing;
$self->EndModal(wxID_OK);
+ $self->Destroy;
});
my $sizer = Wx::BoxSizer->new(wxVERTICAL);
diff --git a/lib/Slic3r/GUI/PreviewCanvas.pm b/lib/Slic3r/GUI/PreviewCanvas.pm
index 44c21c932..69626d44c 100644
--- a/lib/Slic3r/GUI/PreviewCanvas.pm
+++ b/lib/Slic3r/GUI/PreviewCanvas.pm
@@ -323,10 +323,6 @@ sub Resize {
}
}
-sub DESTROY {
- my $self = shift;
-}
-
sub InitGL {
my $self = shift;