Skip to content

Commit

Permalink
Avoid a crash when exiting bzfs
Browse files Browse the repository at this point in the history
  • Loading branch information
atupone committed Apr 13, 2024
1 parent 4d89ea9 commit de25c99
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/bzfs/bzfs.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -7874,6 +7878,7 @@ int main(int argc, char **argv)
Record::kill();
Replay::kill();
Flags::kill();
netLogCB.kill();

#if defined(_WIN32)
WSACleanup();
Expand Down

0 comments on commit de25c99

Please sign in to comment.