Browse Source

[2836] The updater is never NULL in destructor

So remove the condition to check it. Keep an assert there, just in case
there was a reason originally, so we know about it.
Michal 'vorner' Vaner 12 years ago
parent
commit
2cab680045
1 changed files with 5 additions and 6 deletions
  1. 5 6
      src/lib/datasrc/tests/memory/zone_data_updater_unittest.cc

+ 5 - 6
src/lib/datasrc/tests/memory/zone_data_updater_unittest.cc

@@ -81,12 +81,11 @@ protected:
     }
 
     ~ZoneDataUpdaterTest() {
-        if (updater_) {
-            ZoneData::destroy(*mem_sgmt_, getZoneData(), zclass_);
-            // Release the updater, so it frees all memory inside the segment too
-            updater_.reset();
-            mem_sgmt_->clearNamedAddress("Test zone data");
-        }
+        assert(updater_);
+        ZoneData::destroy(*mem_sgmt_, getZoneData(), zclass_);
+        // Release the updater, so it frees all memory inside the segment too
+        updater_.reset();
+        mem_sgmt_->clearNamedAddress("Test zone data");
         if (!mem_sgmt_->allMemoryDeallocated()) {
             ADD_FAILURE() << "Memory leak detected";
         }