Changeset 63940 in webkit
- Timestamp:
- Jul 22, 2010 7:15:09 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r63939 r63940 1 2010-07-22 Patrick Gansterer <paroga@paroga.com> 2 3 Reviewed by Adam Roben. 4 5 [WIN] Correct DeleteObject usage in PasteboardWin 6 https://bugs.webkit.org/show_bug.cgi?id=41956 7 8 Call DeleteObject() if OpenClipboard() fails and don't 9 call DeleteObject() on objects returned from SelectObject(). 10 11 * platform/win/PasteboardWin.cpp: 12 (WebCore::Pasteboard::writeImage): 13 1 14 2010-07-22 Lucas De Marchi <lucas.demarchi@profusion.mobi> 2 15 -
trunk/WebCore/platform/win/PasteboardWin.cpp
r63734 r63940 217 217 HDC compatibleDC = CreateCompatibleDC(0); 218 218 HDC sourceDC = CreateCompatibleDC(0); 219 HBITMAP resultBitmap = CreateCompatibleBitmap(dc, image->width(), image->height());220 H BITMAP oldBitmap = (HBITMAP)SelectObject(compatibleDC, resultBitmap);219 OwnPtr<HBITMAP> resultBitmap(CreateCompatibleBitmap(dc, image->width(), image->height())); 220 HGDIOBJ oldBitmap = SelectObject(compatibleDC, resultBitmap.get()); 221 221 222 222 BitmapInfo bmInfo = BitmapInfo::create(image->size()); 223 223 224 224 HBITMAP coreBitmap = CreateDIBSection(dc, &bmInfo, DIB_RGB_COLORS, 0, 0, 0); 225 H BITMAP oldSource = (HBITMAP)SelectObject(sourceDC, coreBitmap);225 HGDIOBJ oldSource = SelectObject(sourceDC, coreBitmap); 226 226 image->getHBITMAP(coreBitmap); 227 227 … … 230 230 sourceDC, 0, 0, image->width(), image->height(), bf); 231 231 232 SelectObject(sourceDC, oldSource); 233 DeleteObject(coreBitmap); 234 232 235 SelectObject(compatibleDC, oldBitmap); 233 SelectObject(sourceDC, oldSource); 234 235 DeleteObject(oldBitmap); 236 DeleteObject(oldSource); 237 DeleteObject(coreBitmap); 236 DeleteDC(sourceDC); 237 DeleteDC(compatibleDC); 238 238 ReleaseDC(0, dc); 239 DeleteDC(compatibleDC); 240 DeleteDC(sourceDC); 241 242 if (::OpenClipboard(m_owner)) { 243 ::SetClipboardData(CF_BITMAP, resultBitmap); 239 240 if (::OpenClipboard(m_owner)) { 241 ::SetClipboardData(CF_BITMAP, resultBitmap.leakPtr()); 244 242 ::CloseClipboard(); 245 243 }
Note: See TracChangeset
for help on using the changeset viewer.