summaryrefslogtreecommitdiff
path: root/widget/windows/nsWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'widget/windows/nsWindow.cpp')
-rw-r--r--widget/windows/nsWindow.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp
index 8f614d8628..295518ea26 100644
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -3715,22 +3715,21 @@ nsWindow::ClientToWindowSize(const LayoutDeviceIntSize& aClientSize)
void
nsWindow::EnableDragDrop(bool aEnable)
{
- NS_ASSERTION(mWnd, "nsWindow::EnableDragDrop() called after Destroy()");
+ if (!mWnd) {
+ // Return early if the window already closed
+ return;
+ }
nsresult rv = NS_ERROR_FAILURE;
if (aEnable) {
if (!mNativeDragTarget) {
mNativeDragTarget = new nsNativeDragTarget(this);
mNativeDragTarget->AddRef();
- if (SUCCEEDED(::CoLockObjectExternal((LPUNKNOWN)mNativeDragTarget,
- TRUE, FALSE))) {
- ::RegisterDragDrop(mWnd, (LPDROPTARGET)mNativeDragTarget);
- }
+ ::RegisterDragDrop(mWnd, (LPDROPTARGET)mNativeDragTarget);
}
} else {
if (mWnd && mNativeDragTarget) {
::RevokeDragDrop(mWnd);
- ::CoLockObjectExternal((LPUNKNOWN)mNativeDragTarget, FALSE, TRUE);
mNativeDragTarget->DragCancel();
NS_RELEASE(mNativeDragTarget);
}