Bug 1248851 part 4 - Mark UniquePtr::release() MOZ_WARN_UNUSED_RESULT. r=Waldo
authorXidorn Quan <quanxunzhen@gmail.com>
Sat, 20 Feb 2016 11:06:25 +0800
changeset 311410 3374795cf41595b25f0ef25c2a70e364cb24c94d
parent 311409 eb33caf40412a32230585d72f20d5153abcb5215
child 311411 9db8842448dc0899f1c3cf32799fc70cfc582e92
push idunknown
push userunknown
push dateunknown
reviewersWaldo
bugs1248851
milestone47.0a1
Bug 1248851 part 4 - Mark UniquePtr::release() MOZ_WARN_UNUSED_RESULT. r=Waldo MozReview-Commit-ID: FH7t5gZ0nVG
mfbt/UniquePtr.h
--- a/mfbt/UniquePtr.h
+++ b/mfbt/UniquePtr.h
@@ -289,17 +289,17 @@ public:
 
   explicit operator bool() const { return get() != nullptr; }
 
   Pointer get() const { return ptr(); }
 
   DeleterType& getDeleter() { return del(); }
   const DeleterType& getDeleter() const { return del(); }
 
-  Pointer release()
+  MOZ_WARN_UNUSED_RESULT Pointer release()
   {
     Pointer p = ptr();
     ptr() = nullptr;
     return p;
   }
 
   void reset(Pointer aPtr = Pointer())
   {
@@ -424,17 +424,17 @@ public:
   explicit operator bool() const { return get() != nullptr; }
 
   T& operator[](decltype(sizeof(int)) aIndex) const { return get()[aIndex]; }
   Pointer get() const { return mTuple.first(); }
 
   DeleterType& getDeleter() { return mTuple.second(); }
   const DeleterType& getDeleter() const { return mTuple.second(); }
 
-  Pointer release()
+  MOZ_WARN_UNUSED_RESULT Pointer release()
   {
     Pointer p = mTuple.first();
     mTuple.first() = nullptr;
     return p;
   }
 
   void reset(Pointer aPtr = Pointer())
   {