Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: double free segfault when using Handle_Poly_Triangulation_ctor #159

Merged
merged 1 commit into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/opencascade-sys/include/wrapper.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ inline std::unique_ptr<gp_Trsf> TopLoc_Location_Transformation(const TopLoc_Loca
}

inline std::unique_ptr<Handle_Poly_Triangulation>
Handle_Poly_Triangulation_ctor(const Poly_Triangulation &triangulation) {
return std::unique_ptr<Handle_Poly_Triangulation>(new Handle_Poly_Triangulation(&triangulation));
Handle_Poly_Triangulation_ctor(std::unique_ptr<Poly_Triangulation> triangulation) {
return std::unique_ptr<Handle_Poly_Triangulation>(new Handle_Poly_Triangulation(triangulation.release()));
}

inline std::unique_ptr<Handle_Poly_Triangulation> BRep_Tool_Triangulation(const TopoDS_Face &face,
Expand Down
2 changes: 1 addition & 1 deletion crates/opencascade-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ pub mod ffi {
type Handle_Poly_Triangulation;

pub fn Handle_Poly_Triangulation_ctor(
triangulation: &Poly_Triangulation,
triangulation: UniquePtr<Poly_Triangulation>,
) -> UniquePtr<Handle_Poly_Triangulation>;

pub fn IsNull(self: &Handle_Poly_Triangulation) -> bool;
Expand Down