summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFumitoshi Ukai <ukai@google.com>2015-03-27 08:23:20 (GMT)
committerFumitoshi Ukai <ukai@google.com>2015-03-27 08:23:20 (GMT)
commit9c2acaaa49078dcfed146bea2536ad33e10372e8 (patch)
tree99327eae4d567eac141783e43a3fc48cd7ec650b /src
parent1b0b08c8dda1659027677966b03a3ff3c488e549 (diff)
downloadglog-9c2acaaa49078dcfed146bea2536ad33e10372e8.zip
glog-9c2acaaa49078dcfed146bea2536ad33e10372e8.tar.gz
glog-9c2acaaa49078dcfed146bea2536ad33e10372e8.tar.bz2
delete LogDestination::sinks_ at DeleteLogDestinations().
fixes #8 AddLogSink memory leak
Diffstat (limited to 'src')
-rw-r--r--src/logging.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/logging.cc b/src/logging.cc
index 5543e3a..091b0db 100644
--- a/src/logging.cc
+++ b/src/logging.cc
@@ -817,6 +817,11 @@ void LogDestination::DeleteLogDestinations() {
delete log_destinations_[severity];
log_destinations_[severity] = NULL;
}
+ MutexLock l(&sink_mutex_);
+ for (size_t i = 0; i < sinks_->size(); ++i) {
+ delete (*sinks_)[i];
+ }
+ delete sinks_;
}
namespace {