mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 15:39:01 +08:00
Bugfix: split wasn't working properly under threaded perls
This commit is contained in:
parent
2c400ee2b8
commit
1a6eaeaa91
@ -159,8 +159,7 @@ sub new {
|
|||||||
my ($self, $event) = @_;
|
my ($self, $event) = @_;
|
||||||
my ($obj_idx, $thumbnail) = @{$event->GetData};
|
my ($obj_idx, $thumbnail) = @{$event->GetData};
|
||||||
$self->{objects}[$obj_idx]->thumbnail($thumbnail->clone);
|
$self->{objects}[$obj_idx]->thumbnail($thumbnail->clone);
|
||||||
$self->{objects}[$obj_idx]->mesh(undef);
|
$self->on_thumbnail_made($obj_idx);
|
||||||
$self->on_thumbnail_made;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
EVT_COMMAND($self, -1, $PROGRESS_BAR_EVENT, sub {
|
EVT_COMMAND($self, -1, $PROGRESS_BAR_EVENT, sub {
|
||||||
@ -700,7 +699,7 @@ sub make_thumbnail {
|
|||||||
Wx::PostEvent($self, Wx::PlThreadEvent->new(-1, $THUMBNAIL_DONE_EVENT, shared_clone([ $obj_idx, $thumbnail ])));
|
Wx::PostEvent($self, Wx::PlThreadEvent->new(-1, $THUMBNAIL_DONE_EVENT, shared_clone([ $obj_idx, $thumbnail ])));
|
||||||
threads->exit;
|
threads->exit;
|
||||||
} else {
|
} else {
|
||||||
$self->on_thumbnail_made;
|
$self->on_thumbnail_made($obj_idx);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -709,6 +708,9 @@ sub make_thumbnail {
|
|||||||
|
|
||||||
sub on_thumbnail_made {
|
sub on_thumbnail_made {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
my ($obj_idx) = @_;
|
||||||
|
|
||||||
|
$self->{objects}[$obj_idx]->free_mesh;
|
||||||
$self->recenter;
|
$self->recenter;
|
||||||
$self->{canvas}->Refresh;
|
$self->{canvas}->Refresh;
|
||||||
}
|
}
|
||||||
@ -1016,6 +1018,14 @@ sub _trigger_mesh {
|
|||||||
$self->size([$self->mesh->size]) if $self->mesh;
|
$self->size([$self->mesh->size]) if $self->mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub free_mesh {
|
||||||
|
my $self = shift;
|
||||||
|
|
||||||
|
# only delete mesh from memory if we can retrieve it from the original file
|
||||||
|
return unless $self->input_file && $self->input_file_object_id;
|
||||||
|
$self->mesh(undef);
|
||||||
|
}
|
||||||
|
|
||||||
sub get_mesh {
|
sub get_mesh {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user