diff options
author | Jason Rassi <rassi@10gen.com> | 2015-09-24 15:21:31 -0400 |
---|---|---|
committer | Jason Rassi <rassi@10gen.com> | 2015-09-24 16:05:09 -0400 |
commit | ddb8c9ba180e546ead966d0beaeb684e251045d1 (patch) | |
tree | 5978c7a1bf91a4dbf400dabaa4fc1d5511e8d43f | |
parent | baa1d58dfeb0399c39d48de3aca3e2f1d29e102c (diff) | |
download | mongo-ddb8c9ba180e546ead966d0beaeb684e251045d1.tar.gz |
SERVER-20622 Global TTLMonitor obj should be reachable at process exit
-rw-r--r-- | src/mongo/db/ttl.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp index 9e5652d2e42..e54bc1838e2 100644 --- a/src/mongo/db/ttl.cpp +++ b/src/mongo/db/ttl.cpp @@ -319,9 +319,16 @@ private: } }; +namespace { +// The global TTLMonitor object is intentionally leaked. Even though it is only used in one +// function, we declare it here to indicate to the leak sanitizer that the leak of this object +// should not be reported. +TTLMonitor* ttlMonitor = nullptr; +} // namespace + void startTTLBackgroundJob() { - TTLMonitor* ttl = new TTLMonitor(); - ttl->go(); + ttlMonitor = new TTLMonitor(); + ttlMonitor->go(); } string TTLMonitor::secondsExpireField = "expireAfterSeconds"; |