Bug 300853 Caps crash on cleanup [@ DomainPolicy::Drop]

patch by g.maone@informaction.com r=caillon sr=dveditz a=bsmedberg
This commit is contained in:
timeless%mozdev.org 2005-07-19 21:55:36 +00:00
Родитель 5c3c5c02bf
Коммит 741e9f0d95
4 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -21,6 +21,7 @@
*
* Contributor(s):
* Christopher A. Aillon <christopher@aillon.com>
* Giorgio Maone <g.maone@informaction.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or

Просмотреть файл

@ -23,6 +23,7 @@
* Norris Boyd <nboyd@atg.com>
* Mitch Stoltz <mstoltz@netscape.com>
* Christopher A. Aillon <christopher@aillon.com>
* Giorgio Maone <g.maone@informaction.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -79,6 +80,7 @@ struct ClassPolicy;
#define DEBUG_CAPS_CanCreateWrapper
#define DEBUG_CAPS_CanCreateInstance
#define DEBUG_CAPS_CanGetService
#define DEBUG_CAPS_DomainPolicyLifeCycle
#endif
/////////////////////
@ -290,8 +292,9 @@ public:
~DomainPolicy()
{
PL_DHashTableFinish(this);
NS_ASSERTION(mRefCount == 0, "Wrong refcount in DomainPolicy dtor");
#ifdef DEBUG_CAPS_DomainPolicyLifeCycle
printf("DomainPolicy deleted with mRefCount = %d\n", mRefCount);
--sObjects;
_printPopulationInfo();
#endif

Просмотреть файл

@ -21,6 +21,7 @@
*
* Contributor(s):
* Christopher A. Aillon <christopher@aillon.com>
* Giorgio Maone <g.maone@informaction.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or

Просмотреть файл

@ -24,6 +24,7 @@
* Mitch Stoltz
* Steve Morse
* Christopher A. Aillon
* Giorgio Maone
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -2891,7 +2892,8 @@ jsval nsScriptSecurityManager::sEnabledID = JSVAL_VOID;
nsScriptSecurityManager::~nsScriptSecurityManager(void)
{
delete mOriginToPolicyMap;
delete mDefaultPolicy;
if(mDefaultPolicy)
mDefaultPolicy->Drop();
delete mCapabilities;
gScriptSecMan = nsnull;
}
@ -2980,8 +2982,10 @@ nsScriptSecurityManager::InitPolicies()
DomainPolicy::InvalidateAll();
//-- Release old default policy
if(mDefaultPolicy)
if(mDefaultPolicy) {
mDefaultPolicy->Drop();
mDefaultPolicy = nsnull;
}
//-- Initialize a new mOriginToPolicyMap
mOriginToPolicyMap =