зеркало из https://github.com/mozilla/pjs.git
fixed bug17388, dtd leak; r=mscott
This commit is contained in:
Родитель
0caca08867
Коммит
683fc55f15
|
@ -89,7 +89,7 @@ public:
|
|||
class CSharedParserObjects {
|
||||
public:
|
||||
|
||||
CSharedParserObjects() : mDTDDeque(new CDTDDeallocator()) {
|
||||
CSharedParserObjects() : mDTDDeque(0) {
|
||||
|
||||
nsIDTD* theDTD;
|
||||
|
||||
|
@ -104,6 +104,8 @@ public:
|
|||
}
|
||||
|
||||
~CSharedParserObjects() {
|
||||
CDTDDeallocator theDeallocator;
|
||||
mDTDDeque.ForEach(theDeallocator); //release all the DTD's
|
||||
}
|
||||
|
||||
void RegisterDTD(nsIDTD* aDTD){
|
||||
|
@ -119,10 +121,6 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
nsIDTD* FindDTD(nsIDTD* aDTD){
|
||||
return 0;
|
||||
}
|
||||
|
||||
nsDeque mDTDDeque;
|
||||
};
|
||||
|
||||
|
@ -175,6 +173,18 @@ CSharedParserObjects& GetSharedObjects() {
|
|||
return *gSharedParserObjects;
|
||||
}
|
||||
|
||||
/**
|
||||
* This gets called when the htmlparser module is shutdown.
|
||||
*
|
||||
* @update gess 01/04/99
|
||||
*/
|
||||
void nsParser::FreeSharedObjects(void) {
|
||||
if (gSharedParserObjects) {
|
||||
delete gSharedParserObjects;
|
||||
gSharedParserObjects=0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* default constructor
|
||||
*
|
||||
|
|
|
@ -83,9 +83,12 @@ class nsIProgressEventSink;
|
|||
|
||||
|
||||
CLASS_EXPORT_HTMLPARS nsParser : public nsIParser, public nsIStreamListener {
|
||||
|
||||
|
||||
|
||||
public:
|
||||
friend class CTokenHandler;
|
||||
|
||||
friend class CTokenHandler;
|
||||
static void FreeSharedObjects(void);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
@ -400,6 +403,5 @@ public:
|
|||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -187,6 +187,7 @@ nsParserModule::Shutdown()
|
|||
nsHTMLTokenizer::FreeTokenRecycler();
|
||||
nsXMLTokenizer::FreeTokenRecycler();
|
||||
nsExpatTokenizer::FreeTokenRecycler();
|
||||
nsParser::FreeSharedObjects();
|
||||
mInitialized = PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ public:
|
|||
class CSharedParserObjects {
|
||||
public:
|
||||
|
||||
CSharedParserObjects() : mDTDDeque(new CDTDDeallocator()) {
|
||||
CSharedParserObjects() : mDTDDeque(0) {
|
||||
|
||||
nsIDTD* theDTD;
|
||||
|
||||
|
@ -104,6 +104,8 @@ public:
|
|||
}
|
||||
|
||||
~CSharedParserObjects() {
|
||||
CDTDDeallocator theDeallocator;
|
||||
mDTDDeque.ForEach(theDeallocator); //release all the DTD's
|
||||
}
|
||||
|
||||
void RegisterDTD(nsIDTD* aDTD){
|
||||
|
@ -119,10 +121,6 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
nsIDTD* FindDTD(nsIDTD* aDTD){
|
||||
return 0;
|
||||
}
|
||||
|
||||
nsDeque mDTDDeque;
|
||||
};
|
||||
|
||||
|
@ -175,6 +173,18 @@ CSharedParserObjects& GetSharedObjects() {
|
|||
return *gSharedParserObjects;
|
||||
}
|
||||
|
||||
/**
|
||||
* This gets called when the htmlparser module is shutdown.
|
||||
*
|
||||
* @update gess 01/04/99
|
||||
*/
|
||||
void nsParser::FreeSharedObjects(void) {
|
||||
if (gSharedParserObjects) {
|
||||
delete gSharedParserObjects;
|
||||
gSharedParserObjects=0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* default constructor
|
||||
*
|
||||
|
|
|
@ -83,9 +83,12 @@ class nsIProgressEventSink;
|
|||
|
||||
|
||||
CLASS_EXPORT_HTMLPARS nsParser : public nsIParser, public nsIStreamListener {
|
||||
|
||||
|
||||
|
||||
public:
|
||||
friend class CTokenHandler;
|
||||
|
||||
friend class CTokenHandler;
|
||||
static void FreeSharedObjects(void);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
@ -400,6 +403,5 @@ public:
|
|||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -187,6 +187,7 @@ nsParserModule::Shutdown()
|
|||
nsHTMLTokenizer::FreeTokenRecycler();
|
||||
nsXMLTokenizer::FreeTokenRecycler();
|
||||
nsExpatTokenizer::FreeTokenRecycler();
|
||||
nsParser::FreeSharedObjects();
|
||||
mInitialized = PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче