Free @_ before spawning a new thread (known old Perl bug) as an attempt to fix the unref scalars error
This commit is contained in:
parent
48e37f97b4
commit
5494f4f385
@ -84,6 +84,7 @@ sub parallelize {
|
|||||||
$q->enqueue(@items, (map undef, 1..$Config->threads));
|
$q->enqueue(@items, (map undef, 1..$Config->threads));
|
||||||
|
|
||||||
my $thread_cb = sub { $params{thread_cb}->($q) };
|
my $thread_cb = sub { $params{thread_cb}->($q) };
|
||||||
|
@_ = ();
|
||||||
foreach my $th (map threads->create($thread_cb), 1..$Config->threads) {
|
foreach my $th (map threads->create($thread_cb), 1..$Config->threads) {
|
||||||
$params{collect_cb}->($th->join);
|
$params{collect_cb}->($th->join);
|
||||||
}
|
}
|
||||||
|
@ -288,6 +288,7 @@ sub check_version {
|
|||||||
my %p = @_;
|
my %p = @_;
|
||||||
Slic3r::debugf "Checking for updates...\n";
|
Slic3r::debugf "Checking for updates...\n";
|
||||||
|
|
||||||
|
@_ = ();
|
||||||
threads->create(sub {
|
threads->create(sub {
|
||||||
my $ua = LWP::UserAgent->new;
|
my $ua = LWP::UserAgent->new;
|
||||||
$ua->timeout(10);
|
$ua->timeout(10);
|
||||||
|
@ -545,6 +545,7 @@ sub export_gcode {
|
|||||||
|
|
||||||
$self->statusbar->StartBusy;
|
$self->statusbar->StartBusy;
|
||||||
if ($Slic3r::have_threads) {
|
if ($Slic3r::have_threads) {
|
||||||
|
@_ = ();
|
||||||
$self->{export_thread} = threads->create(sub {
|
$self->{export_thread} = threads->create(sub {
|
||||||
$self->export_gcode2(
|
$self->export_gcode2(
|
||||||
$print,
|
$print,
|
||||||
@ -739,6 +740,7 @@ sub make_thumbnail {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@_ = ();
|
||||||
$Slic3r::have_threads ? threads->create($cb)->detach : $cb->();
|
$Slic3r::have_threads ? threads->create($cb)->detach : $cb->();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user