mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-02 20:20:00 +00:00
Allow atom table to be purged during shtudown
This commit is contained in:
parent
556d538c8f
commit
4f9c341b0c
@ -28,6 +28,38 @@
|
|||||||
static nsrefcnt gAtoms;
|
static nsrefcnt gAtoms;
|
||||||
static struct PLHashTable* gAtomHashTable;
|
static struct PLHashTable* gAtomHashTable;
|
||||||
|
|
||||||
|
#if defined(DEBUG_kipp) && (defined(XP_UNIX) || defined(XP_PC))
|
||||||
|
static PRIntn
|
||||||
|
DumpAtomLeaks(PLHashEntry *he, PRIntn index, void *arg)
|
||||||
|
{
|
||||||
|
AtomImpl* atom = (AtomImpl*) he->value;
|
||||||
|
if (atom) {
|
||||||
|
nsAutoString tmp;
|
||||||
|
atom->ToString(tmp);
|
||||||
|
fputs(tmp, stdout);
|
||||||
|
fputs("\n", stdout);
|
||||||
|
}
|
||||||
|
return HT_ENUMERATE_NEXT;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
NS_COM void NS_PurgeAtomTable(void)
|
||||||
|
{
|
||||||
|
if (gAtomHashTable) {
|
||||||
|
#if defined(DEBUG_kipp) && (defined(XP_UNIX) || defined(XP_PC))
|
||||||
|
if (0 != gAtoms) {
|
||||||
|
printf("*** leaking %d atoms\n", gAtoms);
|
||||||
|
if (getenv("MOZ_DUMP_ATOM_LEAKS")) {
|
||||||
|
printf("*** leaked atoms:\n");
|
||||||
|
PL_HashTableEnumerateEntries(gAtomHashTable, DumpAtomLeaks, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
PL_HashTableDestroy(gAtomHashTable);
|
||||||
|
gAtomHashTable = nsnull;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
AtomImpl::AtomImpl()
|
AtomImpl::AtomImpl()
|
||||||
{
|
{
|
||||||
NS_INIT_REFCNT();
|
NS_INIT_REFCNT();
|
||||||
|
@ -77,4 +77,6 @@ extern NS_COM nsIAtom* NS_NewAtom(const nsString& aString);
|
|||||||
*/
|
*/
|
||||||
extern NS_COM nsrefcnt NS_GetNumberOfAtoms(void);
|
extern NS_COM nsrefcnt NS_GetNumberOfAtoms(void);
|
||||||
|
|
||||||
|
extern NS_COM void NS_PurgeAtomTable(void);
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user