Skip to content
Snippets Groups Projects
Commit bab0b71a authored by Kai Bleeke's avatar Kai Bleeke
Browse files

I write one file of C++ code and of course I forgot to free my memory

parent 67d15309
No related branches found
No related tags found
No related merge requests found
......@@ -55,3 +55,6 @@ extern "C" {
extern "C" {
pub fn libbc_blockchain_print(bc: *mut LibBcBlockchain);
}
extern "C" {
pub fn libbc_delete_blockchain(bc: *mut LibBcBlockchain);
}
......@@ -38,4 +38,8 @@ void libbc_blockchain_add(LibBcBlockchain *bc, uint64_t id, struct LibBcPayload
void libbc_blockchain_print(LibBcBlockchain *bc) {
bc->print();
}
void libbc_delete_blockchain(LibBcBlockchain *bc) {
delete bc;
}
\ No newline at end of file
......@@ -33,6 +33,8 @@ extern "C"
void libbc_blockchain_add(LibBcBlockchain *bc, uint64_t id, struct LibBcPayload payload);
void libbc_blockchain_print(LibBcBlockchain *bc);
void libbc_delete_blockchain(LibBcBlockchain *bc);
#ifdef __cplusplus
}
#endif
\ No newline at end of file
......@@ -38,5 +38,6 @@ fn main() {
unsafe {
blockchain_sys::libbc_blockchain_print(blockchain.inner);
blockchain_sys::libbc_delete_blockchain(blockchain.inner);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment