diff options
author | Alessandro Ranellucci <aar@cpan.org> | 2013-11-12 15:09:33 +0400 |
---|---|---|
committer | Alessandro Ranellucci <aar@cpan.org> | 2013-11-12 15:10:32 +0400 |
commit | d0cbf563544b03d2373ed146e6b7f432d919a135 (patch) | |
tree | fe04897070a53292268af2dbc2fbdde98d12ac3e | |
parent | 76213fb5b71f0ab24a59f3740b71a8d1cfee3843 (diff) |
Workaround "Attempt to free unreferenced scalar..." on Linux 32-bit
-rw-r--r-- | lib/Slic3r.pm | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index bb04f3f2f..0205b094c 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -94,9 +94,20 @@ sub parallelize { $q->enqueue(@items, (map undef, 1..$Config->threads)); my $thread_cb = sub { - my $result = $params{thread_cb}->($q); + $params{thread_cb}->($q); Slic3r::thread_cleanup(); - return $result; + + # This explicit exit avoids an untrappable + # "Attempt to free unreferenced scalar" error + # triggered on Ubuntu 12.04 32-bit when we're running + # from the Wx plater and + # we're reusing the same plater object more than once. + # The downside to using this exit is that we can't return + # any value to the main thread but we're not doing that + # anymore anyway. + # collect_cb is completely useless now + # and should be removed from the codebase. + threads->exit; }; $params{collect_cb} ||= sub {}; |