Fix a bad access after recent change about ->p returning objects by reference
This commit is contained in:
parent
dbf739318a
commit
873762491b
@ -606,7 +606,8 @@ sub discover_horizontal_shells {
|
|||||||
next if $n < 0 || $n >= $self->layer_count;
|
next if $n < 0 || $n >= $self->layer_count;
|
||||||
Slic3r::debugf " looking for neighbors on layer %d...\n", $n;
|
Slic3r::debugf " looking for neighbors on layer %d...\n", $n;
|
||||||
|
|
||||||
my @neighbor_fill_surfaces = @{$self->layers->[$n]->regions->[$region_id]->fill_surfaces};
|
my $neighbor_fill_surfaces = $self->layers->[$n]->regions->[$region_id]->fill_surfaces;
|
||||||
|
my @neighbor_fill_surfaces = map $_->clone, @$neighbor_fill_surfaces; # clone because we will use these surfaces even after clearing the collection
|
||||||
|
|
||||||
# find intersection between neighbor and current layer's surfaces
|
# find intersection between neighbor and current layer's surfaces
|
||||||
# intersections have contours and holes
|
# intersections have contours and holes
|
||||||
@ -679,7 +680,6 @@ sub discover_horizontal_shells {
|
|||||||
scalar(@$internal_solid), scalar(@$internal);
|
scalar(@$internal_solid), scalar(@$internal);
|
||||||
|
|
||||||
# assign resulting internal surfaces to layer
|
# assign resulting internal surfaces to layer
|
||||||
my $neighbor_fill_surfaces = $self->layers->[$n]->regions->[$region_id]->fill_surfaces;
|
|
||||||
$neighbor_fill_surfaces->clear;
|
$neighbor_fill_surfaces->clear;
|
||||||
$neighbor_fill_surfaces->append(map Slic3r::Surface->new
|
$neighbor_fill_surfaces->append(map Slic3r::Surface->new
|
||||||
(expolygon => $_, surface_type => S_TYPE_INTERNAL), @$internal);
|
(expolygon => $_, surface_type => S_TYPE_INTERNAL), @$internal);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
// this needs to be included early for MSVC (listing it in Build.PL is not enough)
|
// this needs to be included early for MSVC (listing it in Build.PL is not enough)
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "EXTERN.h"
|
#include "EXTERN.h"
|
||||||
@ -18,4 +19,40 @@ extern "C" {
|
|||||||
namespace Slic3r {}
|
namespace Slic3r {}
|
||||||
using namespace Slic3r;
|
using namespace Slic3r;
|
||||||
|
|
||||||
|
/* Implementation of CONFESS("foo"): */
|
||||||
|
#define CONFESS(...) \
|
||||||
|
confess_at(__FILE__, __LINE__, __func__, __VA_ARGS__)
|
||||||
|
|
||||||
|
void
|
||||||
|
do_confess(SV *error_sv)
|
||||||
|
{
|
||||||
|
dSP;
|
||||||
|
ENTER;
|
||||||
|
SAVETMPS;
|
||||||
|
PUSHMARK(SP);
|
||||||
|
XPUSHs( sv_2mortal(error_sv) );
|
||||||
|
PUTBACK;
|
||||||
|
call_pv("Carp::confess", G_DISCARD);
|
||||||
|
FREETMPS;
|
||||||
|
LEAVE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
confess_at(const char *file, int line, const char *func,
|
||||||
|
const char *pat, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
SV *error_sv = newSVpvf("Error in function %s at %s:%d: ", func,
|
||||||
|
file, line);
|
||||||
|
|
||||||
|
va_start(args, pat);
|
||||||
|
sv_vcatpvf(error_sv, pat, &args);
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
|
sv_catpvn(error_sv, "\n\t", 2);
|
||||||
|
|
||||||
|
do_confess(error_sv);
|
||||||
|
}
|
||||||
|
/* End implementation of CONFESS("foo") */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user