was not unregistering the listers correctly. Not they unreg with the

listener object.
b=48915 r=kmcclusk
This commit is contained in:
rods%netscape.com 2000-08-14 22:05:28 +00:00
Родитель a462b938db
Коммит 3a306b3f7a
2 изменённых файлов: 30 добавлений и 18 удалений

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

@ -257,15 +257,6 @@ nsListControlFrame::~nsListControlFrame()
{
REFLOW_COUNTER_DUMP("nsLCF");
nsCOMPtr<nsIDOMEventReceiver> reciever(do_QueryInterface(mContent));
// we shouldn't have to unregister this listener because when
// our frame goes away all these content node go away as well
// because our frame is the only one who references them.
reciever->RemoveEventListenerByIID((nsIDOMMouseListener *)this, kIDOMMouseListenerIID);
reciever->RemoveEventListenerByIID((nsIDOMMouseMotionListener *)this, kIDOMMouseMotionListenerIID);
reciever->RemoveEventListenerByIID((nsIDOMKeyListener *)this, kIDOMKeyListenerIID);
mComboboxFrame = nsnull;
if (mFormFrame) {
mFormFrame->RemoveFormControlFrame(*this);
@ -281,6 +272,21 @@ nsListControlFrame::~nsListControlFrame()
NS_IMETHODIMP
nsListControlFrame::Destroy(nsIPresContext *aPresContext)
{
// get the reciever interface from the browser button's content node
nsCOMPtr<nsIDOMEventReceiver> reciever(do_QueryInterface(mContent));
nsCOMPtr<nsIDOMMouseListener> mouseListener = do_QueryInterface(mEventListener);
if (!mouseListener) { return NS_ERROR_NO_INTERFACE; }
reciever->RemoveEventListenerByIID(mouseListener, NS_GET_IID(nsIDOMMouseListener));
nsCOMPtr<nsIDOMMouseMotionListener> mouseMotionListener = do_QueryInterface(mEventListener);
if (!mouseMotionListener) { return NS_ERROR_NO_INTERFACE; }
reciever->RemoveEventListenerByIID(mouseMotionListener, NS_GET_IID(nsIDOMMouseMotionListener));
nsCOMPtr<nsIDOMKeyListener> keyListener = do_QueryInterface(mEventListener);
if (!keyListener) { return NS_ERROR_NO_INTERFACE; }
reciever->RemoveEventListenerByIID(keyListener, NS_GET_IID(nsIDOMKeyListener));
if (IsInDropDownMode() == PR_FALSE) {
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
}

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

@ -257,15 +257,6 @@ nsListControlFrame::~nsListControlFrame()
{
REFLOW_COUNTER_DUMP("nsLCF");
nsCOMPtr<nsIDOMEventReceiver> reciever(do_QueryInterface(mContent));
// we shouldn't have to unregister this listener because when
// our frame goes away all these content node go away as well
// because our frame is the only one who references them.
reciever->RemoveEventListenerByIID((nsIDOMMouseListener *)this, kIDOMMouseListenerIID);
reciever->RemoveEventListenerByIID((nsIDOMMouseMotionListener *)this, kIDOMMouseMotionListenerIID);
reciever->RemoveEventListenerByIID((nsIDOMKeyListener *)this, kIDOMKeyListenerIID);
mComboboxFrame = nsnull;
if (mFormFrame) {
mFormFrame->RemoveFormControlFrame(*this);
@ -281,6 +272,21 @@ nsListControlFrame::~nsListControlFrame()
NS_IMETHODIMP
nsListControlFrame::Destroy(nsIPresContext *aPresContext)
{
// get the reciever interface from the browser button's content node
nsCOMPtr<nsIDOMEventReceiver> reciever(do_QueryInterface(mContent));
nsCOMPtr<nsIDOMMouseListener> mouseListener = do_QueryInterface(mEventListener);
if (!mouseListener) { return NS_ERROR_NO_INTERFACE; }
reciever->RemoveEventListenerByIID(mouseListener, NS_GET_IID(nsIDOMMouseListener));
nsCOMPtr<nsIDOMMouseMotionListener> mouseMotionListener = do_QueryInterface(mEventListener);
if (!mouseMotionListener) { return NS_ERROR_NO_INTERFACE; }
reciever->RemoveEventListenerByIID(mouseMotionListener, NS_GET_IID(nsIDOMMouseMotionListener));
nsCOMPtr<nsIDOMKeyListener> keyListener = do_QueryInterface(mEventListener);
if (!keyListener) { return NS_ERROR_NO_INTERFACE; }
reciever->RemoveEventListenerByIID(keyListener, NS_GET_IID(nsIDOMKeyListener));
if (IsInDropDownMode() == PR_FALSE) {
nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE);
}