Don't throw in the Watchdog destructor
authorChristopher Dykes <cdykes@fb.com>
Fri, 5 Aug 2016 16:48:30 +0000 (09:48 -0700)
committerFacebook Github Bot 7 <facebook-github-bot-7-bot@fb.com>
Fri, 5 Aug 2016 16:53:29 +0000 (09:53 -0700)
Summary: As-of C++11, destructors are assumed to be `noexcept` unless explicitly marked otherwise. `Watchdog`'s destructor throws, so switch it to a `LOG(FATAL)` instead.

Reviewed By: andriigrynenko

Differential Revision: D3672621

fbshipit-source-id: 5224ecf85d101462e02e12da257e033bab4db1a1

folly/test/SingletonTestStructs.h

index e0c0b97a4c25e23614d988d5a5453c2a2c6d28ab..fecf5373cced1a9d0bfdaa4f01a7590ccb11cf50 100644 (file)
@@ -39,7 +39,7 @@ struct Watchdog {
 
   ~Watchdog() {
     if (creation_order().back() != this) {
-      throw std::out_of_range("Watchdog destruction order mismatch");
+      LOG(FATAL) << "Watchdog destruction order mismatch";
     }
     creation_order().pop_back();
   }