Skip to content

Commit 666b54d

Browse files
committed
Fix double-free in drag and drop
1 parent 375950f commit 666b54d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/FamiTrackerView.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4126,6 +4126,7 @@ void CFamiTrackerView::BeginDragData(int ChanOffset, int RowOffset)
41264126
m_bDragSource = true;
41274127
m_bDropped = false;
41284128

4129+
// move hMem
41294130
pSrc->CacheGlobalData(mClipboardFormat, hMem);
41304131
DROPEFFECT res = pSrc->DoDragDrop(DROPEFFECT_COPY | DROPEFFECT_MOVE);
41314132

@@ -4144,7 +4145,7 @@ void CFamiTrackerView::BeginDragData(int ChanOffset, int RowOffset)
41444145

41454146
m_bDragSource = false;
41464147

4147-
::GlobalFree(hMem);
4148+
// ~pSrc() calls GlobalFree on hMem.
41484149
}
41494150

41504151
bool CFamiTrackerView::IsDragging() const

0 commit comments

Comments
 (0)