From 67a076b360ae63d0d941faeec5b7fcd2f0461fe0 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 20 May 2012 17:21:31 +0200 Subject: [PATCH] Removing warnings here and there --- lib/Slic3r.pm | 2 +- lib/Slic3r/Config.pm | 4 ++-- lib/Slic3r/GUI/Plater.pm | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index be2e6dcae1..3801c92781 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -41,7 +41,7 @@ use Slic3r::Print::Object; use Slic3r::Surface; use Slic3r::TriangleMesh; -our $threads = $have_threads ? 2 : undef; +our $threads = $have_threads ? 2 : 1; # miscellaneous options our $notes = ''; diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 64f9d78d9c..d291dcdb2b 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -536,9 +536,9 @@ sub validate { # -j, --threads die "Invalid value for --threads\n" - if defined $Slic3r::threads && $Slic3r::threads < 1; + if $Slic3r::threads < 1; die "Your perl wasn't built with multithread support\n" - if defined $Slic3r::threads && $Slic3r::threads > 1 && !$Slic3r::have_threads; + if $Slic3r::threads > 1 && !$Slic3r::have_threads; # --layer-height die "Invalid value for --layer-height\n" diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index 5c4a016c09..1da4fe755c 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -529,7 +529,7 @@ sub on_export_completed { my $self = shift; my ($message) = @_; - $self->{export_thread}->detach; + $self->{export_thread}->detach if $self->{export_thread}; $self->{export_thread} = undef; $self->statusbar->SetCancelCallback(undef); $self->statusbar->StopBusy; @@ -541,7 +541,7 @@ sub on_export_failed { my $self = shift; my ($message) = @_; - $self->{export_thread}->detach; + $self->{export_thread}->detach if $self->{export_thread}; $self->{export_thread} = undef; $self->statusbar->SetCancelCallback(undef); $self->statusbar->StopBusy;