summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/dns/watching_file_reader.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/dns/watching_file_reader.cc b/net/dns/watching_file_reader.cc
index b5f9159..633f3aa 100644
--- a/net/dns/watching_file_reader.cc
+++ b/net/dns/watching_file_reader.cc
@@ -47,6 +47,8 @@ void WatchingFileReader::Cancel() {
cancelled_ = true;
// Let go of the watcher to break the reference cycle.
watcher_.reset();
+ // Destroy the non-thread-safe factory now, since dtor is non-thread-safe.
+ factory_.reset();
}
void WatchingFileReader::OnFilePathChanged(const FilePath& path) {
@@ -59,7 +61,9 @@ void WatchingFileReader::OnFilePathError(const FilePath& path) {
RestartWatch();
}
-WatchingFileReader::~WatchingFileReader() {}
+WatchingFileReader::~WatchingFileReader() {
+ DCHECK(cancelled_);
+}
void WatchingFileReader::RescheduleWatch() {
DCHECK(message_loop_->BelongsToCurrentThread());