From d1b9bdcfcca7b13c6903bdbdb33028106ad0c9cc Mon Sep 17 00:00:00 2001 From: Jan Varga Date: Wed, 2 Nov 2022 06:40:08 +0000 Subject: [PATCH] Bug 1798461 - Allow LastRelease definition in classes which inherit from WritableStream; r=saschanaz Differential Revision: https://phabricator.services.mozilla.com/D160896 --- dom/streams/WritableStream.cpp | 3 ++- dom/streams/WritableStream.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dom/streams/WritableStream.cpp b/dom/streams/WritableStream.cpp index d299cfbaa2c6..2a49e67ed583 100644 --- a/dom/streams/WritableStream.cpp +++ b/dom/streams/WritableStream.cpp @@ -42,7 +42,8 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WITH_JS_MEMBERS( (mPendingAbortRequestReason, mStoredError)) NS_IMPL_CYCLE_COLLECTING_ADDREF(WritableStream) -NS_IMPL_CYCLE_COLLECTING_RELEASE(WritableStream) +NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE(WritableStream, + LastRelease()) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WritableStream) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY NS_INTERFACE_MAP_ENTRY(nsISupports) diff --git a/dom/streams/WritableStream.h b/dom/streams/WritableStream.h index 325638e70de5..ebae34060d86 100644 --- a/dom/streams/WritableStream.h +++ b/dom/streams/WritableStream.h @@ -36,6 +36,8 @@ class WritableStream : public nsISupports, public nsWrapperCache { protected: virtual ~WritableStream(); + virtual void LastRelease() {} + public: explicit WritableStream(const GlobalObject& aGlobal); explicit WritableStream(nsIGlobalObject* aGlobal);