mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 10:55:58 +08:00
Prevent crash when user deleted object from plater before thumbnail was generated in the other thread. #1207
This commit is contained in:
parent
7a8e1e778a
commit
9ea55497c2
@ -253,6 +253,7 @@ sub warning_catcher {
|
|||||||
my ($self, $message_dialog) = @_;
|
my ($self, $message_dialog) = @_;
|
||||||
return sub {
|
return sub {
|
||||||
my $message = shift;
|
my $message = shift;
|
||||||
|
return if $message =~ /GLUquadricObjPtr|Attempt to free unreferenced scalar/;
|
||||||
my @params = ($message, 'Warning', wxOK | wxICON_WARNING);
|
my @params = ($message, 'Warning', wxOK | wxICON_WARNING);
|
||||||
$message_dialog
|
$message_dialog
|
||||||
? $message_dialog->(@params)
|
? $message_dialog->(@params)
|
||||||
|
@ -159,6 +159,7 @@ sub new {
|
|||||||
EVT_COMMAND($self, -1, $THUMBNAIL_DONE_EVENT, sub {
|
EVT_COMMAND($self, -1, $THUMBNAIL_DONE_EVENT, sub {
|
||||||
my ($self, $event) = @_;
|
my ($self, $event) = @_;
|
||||||
my ($obj_idx, $thumbnail) = @{$event->GetData};
|
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->{objects}[$obj_idx]->thumbnail($thumbnail->clone);
|
||||||
$self->on_thumbnail_made($obj_idx);
|
$self->on_thumbnail_made($obj_idx);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user