fix crasher on drop and how we free the data.

This commit is contained in:
pinkerton%netscape.com 1999-09-02 06:47:14 +00:00
Родитель aebc1da0da
Коммит 543644ab9f
1 изменённых файлов: 3 добавлений и 7 удалений

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

@ -212,11 +212,7 @@ nsToolboxFrame::Init(nsIPresContext& aPresContext,
nsCOMPtr<nsIDOMEventReceiver> reciever(do_QueryInterface(content));
if (NS_OK == reciever->AddEventListenerByIID(NS_STATIC_CAST(nsIDOMDragListener*, mDragListenerDelegate), nsIDOMDragListener::GetIID())) {
#ifdef DEBUG_rods
printf("Toolbar registered as Drag Listener\n");
#endif
}
reciever->AddEventListenerByIID(NS_STATIC_CAST(nsIDOMDragListener*, mDragListenerDelegate), nsIDOMDragListener::GetIID());
return rv;
}
@ -884,7 +880,7 @@ nsToolboxFrame::DragDrop(nsIDOMEvent* aMouseEvent)
// Get the string data out of the transferable as a nsISupportsString.
nsCOMPtr<nsISupports> data;
PRUint32 len;
char* whichFlavor;
char* whichFlavor = nsnull;
trans->GetAnyTransferData(&whichFlavor, getter_AddRefs(data), &len);
nsCOMPtr<nsISupportsString> dataAsString ( do_QueryInterface(data) );
@ -896,7 +892,7 @@ nsToolboxFrame::DragDrop(nsIDOMEvent* aMouseEvent)
dragSession->SetCanDrop(PR_TRUE);
}
delete [] whichFlavor;
nsAllocator::Free ( whichFlavor );
}
} // foreach drag item
}