Skip to content

Commit 13168c0

Browse files
committed
Review comments
1 parent 7b049c1 commit 13168c0

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/pyshellext/shellext.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,13 +548,13 @@ class DECLSPEC_UUID(CLSID_DRAGDROPSUPPORT) DragDropSupport : public RuntimeClass
548548
cfDropDescription = RegisterClipboardFormat(CFSTR_DROPDESCRIPTION);
549549
}
550550
if (!cfDropDescription) {
551-
OutputDebugString(L"PyShellExt::DllMain - failed to get CFSTR_DROPDESCRIPTION format");
551+
OutputDebugString(L"PyShellExt::DragDropSupport - failed to get CFSTR_DROPDESCRIPTION format");
552552
}
553553
if (!cfDragWindow) {
554554
cfDragWindow = RegisterClipboardFormat(L"DragWindow");
555555
}
556556
if (!cfDragWindow) {
557-
OutputDebugString(L"PyShellExt::DllMain - failed to get DragWindow format");
557+
OutputDebugString(L"PyShellExt::DragDropSupport - failed to get DragWindow format");
558558
}
559559
}
560560

@@ -771,10 +771,13 @@ class DECLSPEC_UUID(CLSID_DRAGDROPSUPPORT) DragDropSupport : public RuntimeClass
771771
// IDropTarget implementation
772772

773773
STDMETHODIMP DragEnter(IDataObject *pDataObj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) {
774-
HWND hwnd;
774+
HWND hwnd = NULL;
775775

776776
OutputDebugString(L"PyShellExt::DragDropSupport::DragEnter");
777777

778+
if (data_obj) {
779+
data_obj->Release();
780+
}
778781
pDataObj->AddRef();
779782
data_obj = pDataObj;
780783

@@ -794,10 +797,15 @@ class DECLSPEC_UUID(CLSID_DRAGDROPSUPPORT) DragDropSupport : public RuntimeClass
794797
}
795798

796799
STDMETHODIMP DragLeave() {
800+
if (data_obj) {
801+
data_obj->Release();
802+
data_obj = NULL;
803+
}
797804
return S_OK;
798805
}
799806

800807
STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) {
808+
*pdwEffect = DROPEFFECT_MOVE;
801809
return S_OK;
802810
}
803811

0 commit comments

Comments
 (0)