Bug 580128. Call JS_ClearScope on the holder object for XrayWrappers around windows when navigating. r=mrbkap

This commit is contained in:
Peter Van der Beken 2010-10-10 15:38:10 -07:00
parent 42c68caa59
commit a1eae3cb88
2 changed files with 8 additions and 0 deletions

View File

@ -125,6 +125,10 @@ endif
include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES += \
-I$(srcdir)/../../js/src/xpconnect/wrappers \
$(NULL)
ifdef MOZ_X11
CXXFLAGS += $(TK_CFLAGS)
LDFLAGS += $(TK_LIBS)

View File

@ -102,6 +102,7 @@
#include "nsITimelineService.h"
#include "nsDOMScriptObjectHolder.h"
#include "prmem.h"
#include "WrapperFactory.h"
#include "nsGlobalWindow.h"
#ifdef MOZ_JSDEBUGGER
@ -3386,6 +3387,9 @@ nsJSContext::ClearScope(void *aGlobalObj, PRBool aClearFromProtoChain)
ac.enterAndIgnoreErrors(mContext, obj);
JS_ClearScope(mContext, obj);
if (xpc::WrapperFactory::IsXrayWrapper(obj)) {
JS_ClearScope(mContext, &obj->getProxyExtra().toObject());
}
if (!obj->getParent()) {
JS_ClearRegExpStatics(mContext, obj);
}