Parcourir la source

[3407] valgrind complained on a unit test

scheduled write timer was not getting cancelled
before IOService is destroyed.
Thomas Markwalder il y a 11 ans
Parent
commit
7abc8bffa2
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  1. 4 0
      src/bin/d2/tests/d_test_stubs.h

+ 4 - 0
src/bin/d2/tests/d_test_stubs.h

@@ -329,6 +329,10 @@ public:
     /// Note the controller singleton is destroyed. This is essential to ensure
     /// a clean start between tests.
     virtual ~DControllerTest() {
+        if (write_timer_) {
+            write_timer_->cancel();
+        }
+
         getController().reset();
         static_cast<void>(unlink(CFG_TEST_FILE));
     }