Browse Source

posix: Fix assertion when freeing ProcessSingleton

Cheng Zhao 7 years ago
parent
commit
1ff872519c
1 changed files with 4 additions and 0 deletions
  1. 4 0
      chromium_src/chrome/browser/process_singleton_posix.cc

+ 4 - 0
chromium_src/chrome/browser/process_singleton_posix.cc

@@ -735,6 +735,10 @@ ProcessSingleton::ProcessSingleton(
 
 ProcessSingleton::~ProcessSingleton() {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+  // Manually free resources with IO explicitly allowed.
+  base::ThreadRestrictions::ScopedAllowIO allow_io;
+  watcher_ = nullptr;
+  ignore_result(socket_dir_.Delete());
 }
 
 ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {