Skip to content

Commit

Permalink
fix crash hidden by leak
Browse files Browse the repository at this point in the history
  • Loading branch information
cpetig committed Jun 6, 2024
1 parent aebac65 commit 0b35385
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/cpp/tests/native_mesh/mesh/mesh_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ mesh::exports::foo::foo::resources::R::~R() {
}
mesh::exports::foo::foo::resources::R::R(uint32_t a) {
auto ret = fooX3AfooX2FresourcesX23X5BconstructorX5Dr((int32_t(a)));
this->index = wit::ResourceExportBase{ret}.get_handle();
this->rep = *lookup_resource(ret);
wit::ResourceExportBase retobj = wit::ResourceExportBase{ret};
this->index = retobj.get_handle();
this->rep = retobj.take_rep();
}
void mesh::exports::foo::foo::resources::R::Add(uint32_t b) const {
fooX3AfooX2FresourcesX23X5BmethodX5DrX2Eadd((*this).get_rep(), (int32_t(b)));
Expand Down

0 comments on commit 0b35385

Please sign in to comment.