Fix for bug 21271. Check if the current context is the head context in HTMLContentSink::CloseHTML, even though the parser shouldn't let that happen. Fixes crash in Channels dropdown. A=jar R=pollmann.

This commit is contained in:
vidur%netscape.com 1999-12-10 03:36:50 +00:00
Родитель 61aacc4648
Коммит 81f434990e
2 изменённых файлов: 12 добавлений и 0 удалений

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

@ -2448,6 +2448,12 @@ HTMLContentSink::CloseHTML(const nsIParserNode& aNode)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::CloseHTML", aNode, 0, this);
if (nsnull != mHeadContext) {
if(mCurrentContext==mHeadContext) {
PRInt32 numContexts = mContextStack.Count();
// Pop off the second html context if it's not done earlier
mContextStack.RemoveElementAt(--numContexts);
mCurrentContext = nsnull;
}
mHeadContext->End();
delete mHeadContext;
mHeadContext = nsnull;

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

@ -2448,6 +2448,12 @@ HTMLContentSink::CloseHTML(const nsIParserNode& aNode)
SINK_TRACE_NODE(SINK_TRACE_CALLS,
"HTMLContentSink::CloseHTML", aNode, 0, this);
if (nsnull != mHeadContext) {
if(mCurrentContext==mHeadContext) {
PRInt32 numContexts = mContextStack.Count();
// Pop off the second html context if it's not done earlier
mContextStack.RemoveElementAt(--numContexts);
mCurrentContext = nsnull;
}
mHeadContext->End();
delete mHeadContext;
mHeadContext = nsnull;