Bug 1392885 -Add debug message when misusing the guard object.
MozReview-Commit-ID: 78iFX5qUcTC
--- a/mfbt/GuardObjects.h
+++ b/mfbt/GuardObjects.h
@@ -111,17 +111,17 @@ public:
GuardObjectNotificationReceiver() : mStatementDone(false) { }
~GuardObjectNotificationReceiver() {
/*
* Assert that the guard object was not used as a temporary. (Note that
* this assert might also fire if init is not called because the guard
* object's implementation is not using the above macros correctly.)
*/
- MOZ_ASSERT(mStatementDone);
+ MOZ_ASSERT(mStatementDone, "Guard object should not be used as a temporary.");
}
void init(GuardObjectNotifier& aNotifier)
{
aNotifier.setStatementDone(&mStatementDone);
}
};