diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2023-02-13 14:01:06 +0100 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2023-02-13 14:01:06 +0100 |
commit | 5a66fa9c3a3c1d265808ee2049dabaef4bf1a3db (patch) | |
tree | c788286efb6b983d030f8cfbfdf4c7833e75e6a8 | |
parent | c35277837fe52adb19a22a9d18931b3e804b8358 (diff) | |
download | ATCD-5a66fa9c3a3c1d265808ee2049dabaef4bf1a3db.tar.gz |
Check for nil pointers in cleanup
* TAO/tao/PortableServer/Active_Policy_Strategies.cpp:
-rw-r--r-- | TAO/tao/PortableServer/Active_Policy_Strategies.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.cpp b/TAO/tao/PortableServer/Active_Policy_Strategies.cpp index b457efcdc4f..a2a2ce4319b 100644 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.cpp +++ b/TAO/tao/PortableServer/Active_Policy_Strategies.cpp @@ -42,22 +42,22 @@ namespace TAO this->create (policies.request_processing(), policies.servant_retention()); /**/ - if (this->lifespan_strategy_ != 0) + if (this->lifespan_strategy_) { this->lifespan_strategy_->strategy_init (poa); } - if (this->request_processing_strategy_ != 0) + if (this->request_processing_strategy_) { this->request_processing_strategy_->strategy_init (poa); } - if (this->id_uniqueness_strategy_ != 0) + if (this->id_uniqueness_strategy_) { this->id_uniqueness_strategy_->strategy_init (poa); } - if (this->servant_retention_strategy_ != 0) + if (this->servant_retention_strategy_) { this->servant_retention_strategy_->strategy_init (poa); } @@ -66,15 +66,27 @@ namespace TAO void Active_Policy_Strategies::cleanup () { - this->lifespan_strategy_->strategy_cleanup (); + if (this->lifespan_strategy_) + { + this->lifespan_strategy_->strategy_cleanup (); + } this->lifespan_strategy_.reset (nullptr); - this->request_processing_strategy_->strategy_cleanup (); + if (this->request_processing_strategy_) + { + this->request_processing_strategy_->strategy_cleanup (); + } this->request_processing_strategy_.reset (nullptr); - this->id_uniqueness_strategy_->strategy_cleanup (); + if (this->id_uniqueness_strategy_) + { + this->id_uniqueness_strategy_->strategy_cleanup (); + } this->id_uniqueness_strategy_.reset (nullptr); this->implicit_activation_strategy_.reset (nullptr); this->thread_strategy_.reset (nullptr); - this->servant_retention_strategy_->strategy_cleanup (); + if (this->servant_retention_strategy_) + { + this->servant_retention_strategy_->strategy_cleanup (); + } this->servant_retention_strategy_.reset (nullptr); this->id_assignment_strategy_.reset (nullptr); } |