diff --git a/js/xpconnect/src/XPCContext.cpp b/js/xpconnect/src/XPCContext.cpp index 15c35521191..92721f60d5b 100644 --- a/js/xpconnect/src/XPCContext.cpp +++ b/js/xpconnect/src/XPCContext.cpp @@ -77,8 +77,9 @@ XPCContext::~XPCContext() for (PRCList *scopeptr = PR_NEXT_LINK(&mScopes); scopeptr != &mScopes; scopeptr = PR_NEXT_LINK(scopeptr)) { - XPCWrappedNativeScope *scope = (XPCWrappedNativeScope *)scopeptr; - scope->SetContext(nsnull); + XPCWrappedNativeScope *scope = + static_cast(scopeptr); + scope->ClearContext(); } // we do not call JS_RemoveArgumentFormatter because we now only diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index ea70c69cde2..586cb7e0338 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -1606,7 +1606,7 @@ public: static void InitStatics() { gScopes = nsnull; gDyingScopes = nsnull; } XPCContext *GetContext() { return mContext; } - void SetContext(XPCContext *xpcc) { mContext = nsnull; } + void ClearContext() { mContext = nsnull; } nsDataHashtable& GetCachedDOMPrototypes() {