Fix crash on skin switching. r=ben

This commit is contained in:
hyatt%netscape.com 2000-09-03 06:00:09 +00:00
Родитель 14f013552f
Коммит b070ce7be3
4 изменённых файлов: 20 добавлений и 16 удалений

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

@ -585,19 +585,21 @@ nsXBLEventHandler::RemoveEventHandlers()
if (mNextHandler)
mNextHandler->RemoveEventHandlers();
if (mEventName == NS_LITERAL_STRING("bindingattached") ||
mEventName == NS_LITERAL_STRING("bindingdetached")) {
// Release and drop.
NS_RELEASE_THIS();
return;
}
// Figure out if we're using capturing or not.
if (!mProtoHandler)
return;
if (mEventName == NS_LITERAL_STRING("bindingattached") ||
mEventName == NS_LITERAL_STRING("bindingdetached")) {
// Release and drop.
mProtoHandler = nsnull;
NS_RELEASE_THIS();
return;
}
nsCOMPtr<nsIContent> handlerElement;
mProtoHandler->GetHandlerElement(getter_AddRefs(handlerElement));
mProtoHandler = nsnull;
if (!handlerElement)
return;

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

@ -127,7 +127,7 @@ protected:
protected:
nsIDOMEventReceiver* mEventReceiver; // Both of these refs are weak.
nsIXBLPrototypeHandler* mProtoHandler;
nsCOMPtr<nsIXBLPrototypeHandler> mProtoHandler;
nsAutoString mEventName;

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

@ -585,19 +585,21 @@ nsXBLEventHandler::RemoveEventHandlers()
if (mNextHandler)
mNextHandler->RemoveEventHandlers();
if (mEventName == NS_LITERAL_STRING("bindingattached") ||
mEventName == NS_LITERAL_STRING("bindingdetached")) {
// Release and drop.
NS_RELEASE_THIS();
return;
}
// Figure out if we're using capturing or not.
if (!mProtoHandler)
return;
if (mEventName == NS_LITERAL_STRING("bindingattached") ||
mEventName == NS_LITERAL_STRING("bindingdetached")) {
// Release and drop.
mProtoHandler = nsnull;
NS_RELEASE_THIS();
return;
}
nsCOMPtr<nsIContent> handlerElement;
mProtoHandler->GetHandlerElement(getter_AddRefs(handlerElement));
mProtoHandler = nsnull;
if (!handlerElement)
return;

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

@ -127,7 +127,7 @@ protected:
protected:
nsIDOMEventReceiver* mEventReceiver; // Both of these refs are weak.
nsIXBLPrototypeHandler* mProtoHandler;
nsCOMPtr<nsIXBLPrototypeHandler> mProtoHandler;
nsAutoString mEventName;