File tree Expand file tree Collapse file tree 4 files changed +5
-8
lines changed
Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -26,15 +26,13 @@ namespace brpc {
2626BAIDU_CASSERT (sizeof (nshead_t ) == 36 , sizeof_nshead_must_be_36);
2727
2828NsheadService::NsheadService () : _additional_space(0 ) {
29- _status = new (std::nothrow) MethodStatus;
30- LOG_IF (FATAL, _status == NULL ) << " Fail to new MethodStatus" ;
29+ _status = new MethodStatus;
3130}
3231
3332NsheadService::NsheadService (const NsheadServiceOptions& options)
3433 : _status(NULL ), _additional_space(options.additional_space) {
3534 if (options.generate_status ) {
36- _status = new (std::nothrow) MethodStatus;
37- LOG_IF (FATAL, _status == NULL ) << " Fail to new MethodStatus" ;
35+ _status = new MethodStatus;
3836 }
3937}
4038
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ namespace internal {
6565// For more details, see `google::protobuf::ArenaOptions'.
6666template <size_t StartBlockSize, size_t MaxBlockSize>
6767struct ArenaRpcPBMessages : public RpcPBMessages {
68- struct ArenaOptionsWrapper {
68+ class ArenaOptionsWrapper {
6969 public:
7070 ArenaOptionsWrapper () {
7171 options.start_block_size = StartBlockSize;
Original file line number Diff line number Diff line change @@ -714,7 +714,7 @@ friend class Controller;
714714
715715 template <typename T>
716716 int SetServiceMaxConcurrency (T* service) {
717- if (NULL != service) {
717+ if (NULL != service && NULL != service-> _status ) {
718718 const AdaptiveMaxConcurrency* amc = &service->_max_concurrency ;
719719 if (amc->type () == AdaptiveMaxConcurrency::UNLIMITED) {
720720 amc = &_options.method_max_concurrency ;
Original file line number Diff line number Diff line change 2323namespace brpc {
2424
2525ThriftService::ThriftService () {
26- _status = new (std::nothrow) MethodStatus;
27- LOG_IF (FATAL, _status == NULL ) << " Fail to new MethodStatus" ;
26+ _status = new MethodStatus;
2827}
2928
3029ThriftService::~ThriftService () {
You can’t perform that action at this time.
0 commit comments