Bug 1404035 Address unused-result warning in toolkit/components/filewatcher/NativeFileWatcherWin.cpp draft
authorTom Ritter <tom@mozilla.com>
Thu, 28 Sep 2017 12:51:12 -0500
changeset 677751 24cf25d0f7126b99573e04d91c0ba24fc3137757
parent 677750 368d91c2a32a2fad3f9da4a93332c17e96dd4322
child 677752 2cfe53625b720f1e5302a41d1fc8af3c87976152
push id83797
push userbmo:tom@mozilla.com
push dateTue, 10 Oct 2017 18:10:48 +0000
bugs1404035
milestone58.0a1
Bug 1404035 Address unused-result warning in toolkit/components/filewatcher/NativeFileWatcherWin.cpp We are intentionally releasing a UniquePtr here, so mark it Unused. MozReview-Commit-ID: LkLgh4PxyIG
toolkit/components/filewatcher/NativeFileWatcherWin.cpp
--- a/toolkit/components/filewatcher/NativeFileWatcherWin.cpp
+++ b/toolkit/components/filewatcher/NativeFileWatcherWin.cpp
@@ -1334,17 +1334,17 @@ NativeFileWatcherService::AddPath(const 
         &NativeFileWatcherIOTask::AddPathRunnableMethod,
         wrappedCallbacks.get()),
       nsIEventTarget::DISPATCH_NORMAL);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   // Since the dispatch succeeded, we let the runnable own the pointer.
-  wrappedCallbacks.release();
+  Unused << wrappedCallbacks.release();
 
   WakeUpWorkerThread();
 
   return NS_OK;
 }
 
 /**
  * Removes the path from the list of watched resources. Silently ignores the request
@@ -1408,17 +1408,17 @@ NativeFileWatcherService::RemovePath(con
         &NativeFileWatcherIOTask::RemovePathRunnableMethod,
         wrappedCallbacks.get()),
       nsIEventTarget::DISPATCH_NORMAL);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   // Since the dispatch succeeded, we let the runnable own the pointer.
-  wrappedCallbacks.release();
+  Unused << wrappedCallbacks.release();
 
   WakeUpWorkerThread();
 
   return NS_OK;
 }
 
 /**
  * Removes all the watched resources from the watch list and stops the