Skip to content

Commit

Permalink
Fix baidu master service leak (#2717)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenBright authored Jul 29, 2024
1 parent fc56be6 commit 455310a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/brpc/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@ Server::~Server() {
_options.thrift_service = NULL;
#endif

delete _options.baidu_master_service;
_options.baidu_master_service = NULL;

delete _options.http_master_service;
_options.http_master_service = NULL;

Expand Down
7 changes: 7 additions & 0 deletions src/brpc/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@ struct ServerOptions {
// Default: false
bool use_rdma;

// [CAUTION] This option is for implementing specialized baidu-std proxies,
// most users don't need it. Don't change this option unless you fully
// understand the description below.
// If this option is set, all baidu-std requests to the server will be delegated
// to this service.
//
// Owned by Server and deleted in server's destructor.
BaiduMasterService* baidu_master_service;

// [CAUTION] This option is for implementing specialized http proxies,
Expand Down

0 comments on commit 455310a

Please sign in to comment.