mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-23 05:31:32 +00:00
Fix import object destroy
This commit is contained in:
@ -316,7 +316,7 @@ pub unsafe extern "C" fn wasmer_instantiate(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
unsafe { *instance = Box::into_raw(Box::new(new_instance)) as *mut wasmer_instance_t };
|
unsafe { *instance = Box::into_raw(Box::new(new_instance)) as *mut wasmer_instance_t };
|
||||||
// Box::into_raw(import_object); // TODO Review is this the correct way not to drop
|
Box::into_raw(import_object);
|
||||||
wasmer_compile_result_t::WASMER_COMPILE_OK
|
wasmer_compile_result_t::WASMER_COMPILE_OK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,6 @@ int main()
|
|||||||
printf("Destroy instance\n");
|
printf("Destroy instance\n");
|
||||||
wasmer_instance_destroy(instance);
|
wasmer_instance_destroy(instance);
|
||||||
printf("Destroy import object\n");
|
printf("Destroy import object\n");
|
||||||
//wasmer_import_object_destroy(import_object); // TODO update instantiate and try this again
|
wasmer_import_object_destroy(import_object);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@ -41,6 +41,6 @@ int main()
|
|||||||
printf("Destroy instance\n");
|
printf("Destroy instance\n");
|
||||||
wasmer_instance_destroy(instance);
|
wasmer_instance_destroy(instance);
|
||||||
printf("Destroy import object\n");
|
printf("Destroy import object\n");
|
||||||
//wasmer_import_object_destroy(import_object); // TODO update instantiate and try this again
|
wasmer_import_object_destroy(import_object);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Reference in New Issue
Block a user