Skip to content

Commit

Permalink
A fix for leaking control comm
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Feb 7, 2023
1 parent 8b92a0b commit 541343b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/xtarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,11 @@ namespace xw
);

registered_comm.on_close(
[](const ::xeus::xmessage&)
[&](const ::xeus::xmessage&)
{
// TODO need to remove from registry otherwise it is leaking
// This is not trivial. The comm is destructed from within one of its method.
// This works because no other instruction are executed by Xeus afterwards.
comm_registry.erase(registered_comm.id());
}
);
}
Expand Down

0 comments on commit 541343b

Please sign in to comment.