deCOMtaminate nsIFrame::GetWindow; the COM wrapper doesn't ADDREF when it should, the easiest thing to do is to just not use the wrapper. r+sr=dbaron

This commit is contained in:
roc+%cs.cmu.edu 2003-06-24 13:39:15 +00:00
parent a9e0202cc6
commit 542467a8bd
2 changed files with 4 additions and 12 deletions

View File

@ -1458,14 +1458,11 @@ nsEventStateManager :: GenerateDragGesture ( nsIPresContext* aPresContext, nsGUI
#endif
// get the widget from the target frame
nsCOMPtr<nsIWidget> targetWidget;
mGestureDownFrame->GetWindow(aPresContext, getter_AddRefs(targetWidget));
nsEventStatus status = nsEventStatus_eIgnore;
nsMouseEvent event;
event.eventStructType = NS_DRAGDROP_EVENT;
event.message = NS_DRAGDROP_GESTURE;
event.widget = targetWidget;
event.widget = mGestureDownFrame->GetWindow();
event.clickCount = 0;
event.point = mGestureDownPoint;
event.refPoint = mGestureDownRefPoint;
@ -2380,9 +2377,7 @@ nsEventStateManager::UpdateCursor(nsIPresContext* aPresContext,
}
if (aTargetFrame) {
nsCOMPtr<nsIWidget> window;
aTargetFrame->GetWindow(aPresContext, getter_AddRefs(window));
SetCursor(cursor, window, PR_FALSE);
SetCursor(cursor, aTargetFrame->GetWindow(), PR_FALSE);
}
if (mLockCursor || NS_STYLE_CURSOR_AUTO != cursor) {

View File

@ -2062,14 +2062,11 @@ GetEditorContentWindow(nsIPresShell *aPresShell, nsIDOMElement *aRoot, nsIWidget
// which will traverse it's parent hierarchy till it finds a
// view with a widget.
result = frame->GetWindow(presContext, aResult);
if (NS_FAILED(result))
return result;
*aResult = frame->GetWindow();
if (!*aResult)
return NS_ERROR_FAILURE;
NS_ADDREF(*aResult);
return NS_OK;
}