Skip to content

Commit

Permalink
Merge pull request #246 from MrAnno/fix-grpc-leaks
Browse files Browse the repository at this point in the history
grpc: add global destructor to avoid leaks when the module is not used
  • Loading branch information
alltilla authored Aug 12, 2024
2 parents 3ac24af + fe32c9e commit a89b865
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/grpc/protos/apphook.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2024 Axoflow
* Copyright (c) 2024 László Várady
*
* This program is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -58,3 +59,9 @@ grpc_register_global_initializers(void)
initialized = TRUE;
}
}

static void __attribute__((destructor))
_protobuf_cleanup(void)
{
google::protobuf::ShutdownProtobufLibrary();
}

0 comments on commit a89b865

Please sign in to comment.