commit 3b79c3ae3e1021d61be6c09defc9d761480e5fae
parent 9850c69f6ebc3bcc9ba494a1888fa3a714a3d04f
Author: Sandor Molnar <smolnar@mozilla.com>
Date: Tue, 25 Nov 2025 23:39:04 +0200
Revert "Bug 1991834 - Add a diagnostic error to nsMaybeWeakPtrArray::AppendWeakElement to avoid double adding. r=xpcom-reviewers,mccr8,Gijs" for causing assertion failures @ nsMaybeWeakPtr.h
This reverts commit f2439f05ebfa066c53f087425e3993f109e88f0d.
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;
}