diff --git a/crates/cpp/tests/native_mesh/mesh/mesh_native.cpp b/crates/cpp/tests/native_mesh/mesh/mesh_native.cpp index 51af4afb0..a3d1a9af5 100644 --- a/crates/cpp/tests/native_mesh/mesh/mesh_native.cpp +++ b/crates/cpp/tests/native_mesh/mesh/mesh_native.cpp @@ -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)));