From de25c9993ee59199f2dde8636c386d2f5deafc0d Mon Sep 17 00:00:00 2001 From: Alfredo Tupone Date: Sat, 13 Apr 2024 18:31:10 +0200 Subject: [PATCH] Avoid a crash when exiting bzfs --- src/bzfs/bzfs.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bzfs/bzfs.cxx b/src/bzfs/bzfs.cxx index 66477be556..4d19116adb 100644 --- a/src/bzfs/bzfs.cxx +++ b/src/bzfs/bzfs.cxx @@ -192,11 +192,15 @@ class BZFSNetLogCB : NetworkDataLogCallback addNetworkLogCallback(this); } - virtual ~BZFSNetLogCB() + void kill() { removeNetworkLogCallback(this); } + virtual ~BZFSNetLogCB() + { + } + virtual void networkDataLog ( bool send, bool udp, const unsigned char *data, unsigned int size, void *param ) { // let any listeners know we got net data @@ -7874,6 +7878,7 @@ int main(int argc, char **argv) Record::kill(); Replay::kill(); Flags::kill(); + netLogCB.kill(); #if defined(_WIN32) WSACleanup();