From 8b88623463bf30ae7e5fcc64ef7d8d5fb62354c9 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Mon, 23 Dec 2019 01:21:32 +0100 Subject: Issue #1118 - Part 9: Don't allow reuse of unlinked CallbackObjectHolder. --- dom/bindings/CallbackObject.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dom/bindings/CallbackObject.h') diff --git a/dom/bindings/CallbackObject.h b/dom/bindings/CallbackObject.h index 8a3d45dfce..5cc98fd5df 100644 --- a/dom/bindings/CallbackObject.h +++ b/dom/bindings/CallbackObject.h @@ -514,8 +514,9 @@ private: { // NS_IF_RELEASE because we might have been unlinked before nsISupports* ptr = GetISupports(); - NS_IF_RELEASE(ptr); + // Clear mPtrBits before the release to prevent reentrance. mPtrBits = 0; + NS_IF_RELEASE(ptr); } uintptr_t mPtrBits; -- cgit v1.2.3