Commit ca9bb391 authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

provider now properly deleting engine when using a margo instance

parent 5bccb356
......@@ -26,11 +26,9 @@ Provider::Provider(tl::engine& engine, uint16_t provider_id, const tl::pool& p)
Provider::Provider(margo_instance_id mid, uint16_t provider_id, const tl::pool& p) {
auto engine = new tl::engine(mid);
margo_push_finalize_callback(mid, delete_engine, static_cast<void*>(engine));
self = std::make_shared<ProviderImpl>(*engine, provider_id, p);
engine->push_finalize_callback(this, [p=this]() { p->self.reset(); });
// TODO this should be uncommented when thallium's finalization mechanism is fixed.
// For now we are leaking memory.
// margo_push_finalize_callback(mid, delete_engine, static_cast<void*>(engine));
}
Provider::Provider(Provider&& other) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment