diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2013-03-13 21:44:30 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2013-03-13 21:44:30 +0000 |
| commit | 3e19ed88ad827fc4e9e638713d672f6fa5346926 (patch) | |
| tree | 79e44f01ba54b5a8c41818ab0a4e37e832c358d3 /src/2geom/basic-intersection.cpp | |
| parent | cppcheck (diff) | |
| download | inkscape-3e19ed88ad827fc4e9e638713d672f6fa5346926.tar.gz inkscape-3e19ed88ad827fc4e9e638713d672f6fa5346926.zip | |
Fix build failure with clang. Thanks to Samuel Chase for patch (leaks fixed).
(bzr r12202)
Diffstat (limited to 'src/2geom/basic-intersection.cpp')
| -rw-r--r-- | src/2geom/basic-intersection.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/2geom/basic-intersection.cpp b/src/2geom/basic-intersection.cpp index 3be6792b9..544bf0dd1 100644 --- a/src/2geom/basic-intersection.cpp +++ b/src/2geom/basic-intersection.cpp @@ -64,7 +64,12 @@ void find_intersections(std::vector< std::pair<double, double> > & xs, void split(vector<Point> const &p, double t, vector<Point> &left, vector<Point> &right) { const unsigned sz = p.size(); - Geom::Point Vtemp[sz][sz]; + + Geom::Point **Vtemp = new Geom::Point* [sz]; + + for (unsigned int i = 0; i < sz; ++i) { + Vtemp[i] = new Geom::Point[sz]; + } /* Copy control points */ std::copy(p.begin(), p.end(), Vtemp[0]); @@ -82,6 +87,11 @@ void split(vector<Point> const &p, double t, left[j] = Vtemp[j][0]; for (unsigned j = 0; j < sz; j++) right[j] = Vtemp[sz-1-j][j]; + + for (unsigned int i = 0; i < sz; ++i) + delete[] Vtemp[i]; + + delete[] Vtemp; } |
