commit f3bbcc9720640b45817beab63e6d6774cac0f7b7
parent 9e27f248e2345d7ea8eb91c748ca5e97d605e870
Author: Cristina Horotan <chorotan@mozilla.com>
Date: Wed, 10 Dec 2025 08:41:44 +0200
Revert "Bug 1991834 - Add a diagnostic error to nsMaybeWeakPtrArray::AppendWeakElement to avoid double adding. r=xpcom-reviewers,mccr8,Gijs" on request for causing nightly parent crashes
This reverts commit fcd571291907b53e85d5e4ba1234be2ecf5b8e1e.
Diffstat:
1 file changed, 0 insertions(+), 10 deletions(-)
diff --git a/xpcom/base/nsMaybeWeakPtr.h b/xpcom/base/nsMaybeWeakPtr.h
@@ -11,7 +11,6 @@
#include "nsIWeakReferenceUtils.h"
#include "nsTArray.h"
#include "nsCycleCollectionNoteChild.h"
-#include "xpcpublic.h"
// nsMaybeWeakPtr is a helper object to hold a strong-or-weak reference
// to the template class. It's pretty minimal, but sufficient.
@@ -82,15 +81,6 @@ class nsMaybeWeakPtrArray : public CopyableTArray<nsMaybeWeakPtr<T>> {
nsMaybeWeakPtr<T> ref;
MOZ_TRY(SetMaybeWeakPtr(ref, aElement, aOwnsWeak));
-#if (defined(MOZ_DIAGNOSTIC_ASSERT_ENABLED) && !defined(MOZ_THUNDERBIRD))
- // Checking for duplicates is expensive, so we enforce callers to avoid
- // this with a diagnostic assertion. See bug 2000788 for Thunderbird.
- if (MaybeWeakArray::Contains(aElement)) {
- xpc_DumpJSStack(true, true, false);
- MOZ_DIAGNOSTIC_ASSERT(false, "Element already in array.");
- }
-#endif
-
MaybeWeakArray::AppendElement(ref);
return NS_OK;
}