diff options
| author | Daniel Kraft <[email protected]> | 2020-09-01 09:40:43 +0200 |
|---|---|---|
| committer | Daniel Kraft <[email protected]> | 2020-09-07 10:55:54 +0200 |
| commit | b93b9d54569145bfcec6cee10968284fe05fe254 (patch) | |
| tree | 189c310dc208a2b6ab3bd633f0a396c3f733b797 /src/validationinterface.cpp | |
| parent | Various cleanups in zmqnotificationinterface. (diff) | |
| download | discoin-b93b9d54569145bfcec6cee10968284fe05fe254.tar.xz discoin-b93b9d54569145bfcec6cee10968284fe05fe254.zip | |
Simplify and fix notifier removal on error.
This factors out the common logic to run over all ZMQ notifiers, call a
function on them, and remove them from the list if the function fails is
extracted to a helper method.
Note that this also fixes a potential memory leak: When a notifier was
removed previously after its callback returned false, it would just be
removed from the list without destructing the object. This is now done
correctly by std::unique_ptr behind the scenes.
Diffstat (limited to 'src/validationinterface.cpp')
0 files changed, 0 insertions, 0 deletions