correctly remove event listeners when frame goes away. fixes bug 19542, r=rjc

This commit is contained in:
pinkerton%netscape.com 1999-12-01 22:02:33 +00:00
parent e986659786
commit 812bedeaed
2 changed files with 6 additions and 4 deletions

View File

@ -201,8 +201,9 @@ nsToolbarFrame :: ~nsToolbarFrame ( )
GetContent(getter_AddRefs(content));
nsCOMPtr<nsIDOMEventReceiver> reciever(do_QueryInterface(content));
// NOTE: the Remove will delete the drag listener
reciever->RemoveEventListenerByIID((nsIDOMDragListener *)mDragListener, nsIDOMDragListener::GetIID());
// NOTE: the last Remove will delete the drag listener
reciever->RemoveEventListener("dragover", mDragListener, PR_TRUE);
reciever->RemoveEventListener("dragexit", mDragListener, PR_TRUE);
}

View File

@ -88,8 +88,9 @@ nsTreeRowGroupFrame::~nsTreeRowGroupFrame()
GetContent(getter_AddRefs(content));
nsCOMPtr<nsIDOMEventReceiver> reciever(do_QueryInterface(content));
// NOTE: the Remove will delete the drag capturer
reciever->RemoveEventListenerByIID((nsIDOMDragListener *)mDragCapturer, nsIDOMDragListener::GetIID());
// NOTE: the last Remove will delete the drag capturer
reciever->RemoveEventListener("dragover", mDragCapturer, PR_TRUE);
reciever->RemoveEventListener("dragexit", mDragCapturer, PR_TRUE);
NS_IF_RELEASE(mContentChain);
}