add null ptr check to stop crash seen in talkback

This commit is contained in:
rickg%netscape.com 2000-03-28 01:08:36 +00:00
Родитель 81c455b21f
Коммит 90abf06a10
2 изменённых файлов: 54 добавлений и 42 удалений

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

@ -739,28 +739,34 @@ FrameManager::DequeuePostedEventFor(nsIFrame* aFrame)
} }
void void
FrameManager::HandlePLEvent(CantRenderReplacedElementEvent* aEvent) FrameManager::HandlePLEvent(CantRenderReplacedElementEvent* aEvent) {
{
FrameManager* frameManager = (FrameManager*)aEvent->owner; FrameManager* frameManager = (FrameManager*)aEvent->owner;
// Remove the posted event from the linked list //adding a ptr check since talkback is complaining about a crash here.
CantRenderReplacedElementEvent** events = &frameManager->mPostedEvents; //I suspect that if the event->owner is really null, bad things will happen
while (*events) { //elsewhere.
if (*events == aEvent) { if(frameManager) {
*events = (*events)->mNext;
break;
} else {
events = &(*events)->mNext;
}
}
// Notify the style system and then process any reflow commands that // Remove the posted event from the linked list
// are generated CantRenderReplacedElementEvent** events = &frameManager->mPostedEvents;
nsCOMPtr<nsIPresContext> presContext; while (*events) {
frameManager->mPresShell->EnterReflowLock(); if (*events == aEvent) {
frameManager->mPresShell->GetPresContext(getter_AddRefs(presContext)); *events = (*events)->mNext;
frameManager->mStyleSet->CantRenderReplacedElement(presContext, aEvent->mFrame); break;
frameManager->mPresShell->ExitReflowLock(PR_TRUE); } else {
events = &(*events)->mNext;
}
}
// Notify the style system and then process any reflow commands that
// are generated
nsCOMPtr<nsIPresContext> presContext;
frameManager->mPresShell->EnterReflowLock();
frameManager->mPresShell->GetPresContext(getter_AddRefs(presContext));
frameManager->mStyleSet->CantRenderReplacedElement(presContext, aEvent->mFrame);
frameManager->mPresShell->ExitReflowLock(PR_TRUE);
}
} }
void void

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

@ -739,28 +739,34 @@ FrameManager::DequeuePostedEventFor(nsIFrame* aFrame)
} }
void void
FrameManager::HandlePLEvent(CantRenderReplacedElementEvent* aEvent) FrameManager::HandlePLEvent(CantRenderReplacedElementEvent* aEvent) {
{
FrameManager* frameManager = (FrameManager*)aEvent->owner; FrameManager* frameManager = (FrameManager*)aEvent->owner;
// Remove the posted event from the linked list //adding a ptr check since talkback is complaining about a crash here.
CantRenderReplacedElementEvent** events = &frameManager->mPostedEvents; //I suspect that if the event->owner is really null, bad things will happen
while (*events) { //elsewhere.
if (*events == aEvent) { if(frameManager) {
*events = (*events)->mNext;
break;
} else {
events = &(*events)->mNext;
}
}
// Notify the style system and then process any reflow commands that // Remove the posted event from the linked list
// are generated CantRenderReplacedElementEvent** events = &frameManager->mPostedEvents;
nsCOMPtr<nsIPresContext> presContext; while (*events) {
frameManager->mPresShell->EnterReflowLock(); if (*events == aEvent) {
frameManager->mPresShell->GetPresContext(getter_AddRefs(presContext)); *events = (*events)->mNext;
frameManager->mStyleSet->CantRenderReplacedElement(presContext, aEvent->mFrame); break;
frameManager->mPresShell->ExitReflowLock(PR_TRUE); } else {
events = &(*events)->mNext;
}
}
// Notify the style system and then process any reflow commands that
// are generated
nsCOMPtr<nsIPresContext> presContext;
frameManager->mPresShell->EnterReflowLock();
frameManager->mPresShell->GetPresContext(getter_AddRefs(presContext));
frameManager->mStyleSet->CantRenderReplacedElement(presContext, aEvent->mFrame);
frameManager->mPresShell->ExitReflowLock(PR_TRUE);
}
} }
void void