diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index ef75ddb32..bc521cf1e 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -741,12 +741,11 @@ sub make_thumbnail { if ($Slic3r::have_threads) { Wx::PostEvent($self, Wx::PlThreadEvent->new(-1, $THUMBNAIL_DONE_EVENT, shared_clone([ $obj_idx, $thumbnail ]))); + Slic3r::thread_cleanup(); threads->exit; } else { $self->on_thumbnail_made($obj_idx); } - - Slic3r::thread_cleanup() if $Slic3r::have_threads; }; @_ = (); diff --git a/xs/xsp/ExPolygon.xsp b/xs/xsp/ExPolygon.xsp index be8d4aa61..081b7ed25 100644 --- a/xs/xsp/ExPolygon.xsp +++ b/xs/xsp/ExPolygon.xsp @@ -29,12 +29,12 @@ ExPolygon::new(...) SV* ExPolygon::arrayref() CODE: - const unsigned int num_holes = THIS->holes.size(); AV* av = newAV(); - av_fill(av, num_holes); // -1 +1 + av_fill(av, THIS->holes.size()); // -1 +1 av_store(av, 0, polygon2perl(THIS->contour)); - for (unsigned int i = 0; i < num_holes; i++) { - av_store(av, i+1, polygon2perl(THIS->holes[i])); + int i = 0; + for (Polygons::iterator it = THIS->holes.begin(); it != THIS->holes.end(); ++it) { + av_store(av, ++i, polygon2perl(*it)); } RETVAL = sv_bless(newRV_noinc((SV*)av), gv_stashpv("Slic3r::ExPolygon", GV_ADD)); OUTPUT: