From bee96124c5e00113caec0ef01240e4c328b4f26f Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 24 Apr 2026 20:38:39 +0200 Subject: [PATCH] [DOM] Avoid leaks in nsXMLPrettyPrinter. --- dom/xml/nsXMLPrettyPrinter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dom/xml/nsXMLPrettyPrinter.cpp b/dom/xml/nsXMLPrettyPrinter.cpp index 7f1f2b07a8..3573523186 100644 --- a/dom/xml/nsXMLPrettyPrinter.cpp +++ b/dom/xml/nsXMLPrettyPrinter.cpp @@ -256,6 +256,8 @@ nsXMLPrettyPrinter::ContentRemoved(nsIDocument* aDocument, void nsXMLPrettyPrinter::NodeWillBeDestroyed(const nsINode* aNode) { + MOZ_DIAGNOSTIC_ASSERT(mDocument == aNode); + mDocument->RemoveMutationObserver(this); mDocument = nullptr; NS_RELEASE_THIS(); }