diff --git a/src/triangulation.jl b/src/triangulation.jl index 94a10eb6..06e2e894 100644 --- a/src/triangulation.jl +++ b/src/triangulation.jl @@ -183,7 +183,7 @@ function earcut_triangulate(polygon::Vector{Vector{Point{2,Float64}}}) len = UInt32(length(lengths)) array = ccall((:u32_triangulate_f64, libearcut), Tuple{Ptr{GLTriangleFace},Cint}, (Ptr{Ptr{Float64}}, Ptr{UInt32}, UInt32), polygon, lengths, len) - return unsafe_wrap(Vector{GLTriangleFace}, array[1], array[2]) + return unsafe_wrap(Vector{GLTriangleFace}, array[1], array[2]; own=true) end function earcut_triangulate(polygon::Vector{Vector{Point{2,Float32}}}) @@ -191,7 +191,7 @@ function earcut_triangulate(polygon::Vector{Vector{Point{2,Float32}}}) len = UInt32(length(lengths)) array = ccall((:u32_triangulate_f32, libearcut), Tuple{Ptr{GLTriangleFace},Cint}, (Ptr{Ptr{Float32}}, Ptr{UInt32}, UInt32), polygon, lengths, len) - return unsafe_wrap(Vector{GLTriangleFace}, array[1], array[2]) + return unsafe_wrap(Vector{GLTriangleFace}, array[1], array[2]; own=true) end function earcut_triangulate(polygon::Vector{Vector{Point{2,Int64}}}) @@ -199,7 +199,7 @@ function earcut_triangulate(polygon::Vector{Vector{Point{2,Int64}}}) len = UInt32(length(lengths)) array = ccall((:u32_triangulate_i64, libearcut), Tuple{Ptr{GLTriangleFace},Cint}, (Ptr{Ptr{Int64}}, Ptr{UInt32}, UInt32), polygon, lengths, len) - return unsafe_wrap(Vector{GLTriangleFace}, array[1], array[2]) + return unsafe_wrap(Vector{GLTriangleFace}, array[1], array[2]; own=true) end function earcut_triangulate(polygon::Vector{Vector{Point{2,Int32}}}) @@ -207,7 +207,7 @@ function earcut_triangulate(polygon::Vector{Vector{Point{2,Int32}}}) len = UInt32(length(lengths)) array = ccall((:u32_triangulate_i32, libearcut), Tuple{Ptr{GLTriangleFace},Cint}, (Ptr{Ptr{Int32}}, Ptr{UInt32}, UInt32), polygon, lengths, len) - return unsafe_wrap(Vector{GLTriangleFace}, array[1], array[2]) + return unsafe_wrap(Vector{GLTriangleFace}, array[1], array[2]; own=true) end best_earcut_eltype(x) = Float64