From 7302bb4484d517a72cdffbd13ec7a9f2324cde01 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Sat, 29 Oct 2016 11:41:53 +0200 Subject: 8.6 --- zen/dir_watcher.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'zen/dir_watcher.cpp') diff --git a/zen/dir_watcher.cpp b/zen/dir_watcher.cpp index 769aa4f2..12a6a9f4 100644 --- a/zen/dir_watcher.cpp +++ b/zen/dir_watcher.cpp @@ -194,7 +194,7 @@ public: true, //__in BOOL bManualReset, false, //__in BOOL bInitialState, nullptr); //__in_opt LPCTSTR lpName - if (overlapped.hEvent == nullptr) + if (!overlapped.hEvent) { const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! return shared_->reportError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(dirPathPf)), formatSystemError(L"CreateEvent", ec)); @@ -319,7 +319,7 @@ private: } -struct DirWatcher::Pimpl +struct DirWatcher::Impl { InterruptibleThread worker; std::shared_ptr shared; @@ -329,7 +329,7 @@ struct DirWatcher::Pimpl DirWatcher::DirWatcher(const Zstring& dirPath) : //throw FileError baseDirPath(dirPath), - pimpl_(std::make_unique()) + pimpl_(std::make_unique()) { pimpl_->shared = std::make_shared(); @@ -345,7 +345,7 @@ DirWatcher::~DirWatcher() { pimpl_->worker.interrupt(); pimpl_->worker.detach(); //we don't have time to wait... would take ~50ms - //Windows caveat: exitting the app will kill the thread and leak memory! + //Windows caveat: exitting the app will kill the thread and leak memory! } } @@ -375,7 +375,7 @@ std::vector DirWatcher::getChanges(const std::function watchDescrs; //watch descriptor and (sub-)directory name (postfixed with separator) -> owned by "notifDescr" @@ -384,7 +384,7 @@ struct DirWatcher::Pimpl DirWatcher::DirWatcher(const Zstring& dirPath) : //throw FileError baseDirPath(dirPath), - pimpl_(std::make_unique()) + pimpl_(std::make_unique()) { //get all subdirectories std::vector fullFolderList { baseDirPath }; @@ -553,7 +553,7 @@ void eventCallback(ConstFSEventStreamRef streamRef, } -struct DirWatcher::Pimpl +struct DirWatcher::Impl { FSEventStreamRef eventStream = nullptr; std::vector changedFiles; @@ -562,7 +562,7 @@ struct DirWatcher::Pimpl DirWatcher::DirWatcher(const Zstring& dirPath) : baseDirPath(dirPath), - pimpl_(std::make_unique()) + pimpl_(std::make_unique()) { CFStringRef dirpathCf = nullptr; try -- cgit