Bug 217967 FF104 crash [@ PL_DHashTableOperate ] changing caps access control prefs
More consistent DomainPolicy lifecycle management avoids use of corrupted hashtable data patch by g.maone@informaction.com r=dveditz sr=shaver a=bsmedberg git-svn-id: svn://10.0.0.236/trunk@175300 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -259,6 +259,13 @@ public:
|
||||
DomainPolicy() : mWildcardPolicy(nsnull),
|
||||
mRefCount(0)
|
||||
{
|
||||
mGeneration = sGeneration;
|
||||
|
||||
#ifdef DEBUG_CAPS_DomainPolicyLifeCycle
|
||||
++sObjects;
|
||||
_printPopulationInfo();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
PRBool Init()
|
||||
@@ -283,6 +290,12 @@ public:
|
||||
~DomainPolicy()
|
||||
{
|
||||
PL_DHashTableFinish(this);
|
||||
|
||||
#ifdef DEBUG_CAPS_DomainPolicyLifeCycle
|
||||
--sObjects;
|
||||
_printPopulationInfo();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void Hold()
|
||||
@@ -295,11 +308,29 @@ public:
|
||||
if (--mRefCount == 0)
|
||||
delete this;
|
||||
}
|
||||
|
||||
|
||||
static void InvalidateAll()
|
||||
{
|
||||
sGeneration++;
|
||||
}
|
||||
|
||||
PRBool IsInvalid()
|
||||
{
|
||||
return mGeneration != sGeneration;
|
||||
}
|
||||
|
||||
ClassPolicy* mWildcardPolicy;
|
||||
|
||||
private:
|
||||
PRUint32 mRefCount;
|
||||
PRUint32 mGeneration;
|
||||
static PRUint32 sGeneration;
|
||||
|
||||
#ifdef DEBUG_CAPS_DomainPolicyLifeCycle
|
||||
static PRUint32 sObjects;
|
||||
static void _printPopulationInfo();
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user