From 9ea55497c255930b92984e1457ea9e1caa8f3a65 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Fri, 7 Jun 2013 13:54:40 +0200 Subject: [PATCH] Prevent crash when user deleted object from plater before thumbnail was generated in the other thread. #1207 --- lib/Slic3r/GUI.pm | 1 + lib/Slic3r/GUI/Plater.pm | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm index fd46cc5eb..00e56f4fa 100644 --- a/lib/Slic3r/GUI.pm +++ b/lib/Slic3r/GUI.pm @@ -253,6 +253,7 @@ sub warning_catcher { my ($self, $message_dialog) = @_; return sub { my $message = shift; + return if $message =~ /GLUquadricObjPtr|Attempt to free unreferenced scalar/; my @params = ($message, 'Warning', wxOK | wxICON_WARNING); $message_dialog ? $message_dialog->(@params) diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index 286a524e2..dc17bdcf8 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -159,6 +159,7 @@ sub new { EVT_COMMAND($self, -1, $THUMBNAIL_DONE_EVENT, sub { my ($self, $event) = @_; my ($obj_idx, $thumbnail) = @{$event->GetData}; + return if !$self->{objects}[$obj_idx]; # object was deleted before thumbnail generation completed $self->{objects}[$obj_idx]->thumbnail($thumbnail->clone); $self->on_thumbnail_made($obj_idx); });