[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 11:25:44 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d71cd2078b50da2030110aacb1a0f4da040c1df0
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 23 02:15:09 2010 +0000

    2010-07-22  Patrick Gansterer  <paroga at paroga.com>
    
            Reviewed by Adam Roben.
    
            [WIN] Correct DeleteObject usage in PasteboardWin
            https://bugs.webkit.org/show_bug.cgi?id=41956
    
            Call DeleteObject() if OpenClipboard() fails and don't
            call DeleteObject() on objects returned from SelectObject().
    
            * platform/win/PasteboardWin.cpp:
            (WebCore::Pasteboard::writeImage):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63940 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6aa345f..122a5e8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-07-22  Patrick Gansterer  <paroga at paroga.com>
+
+        Reviewed by Adam Roben.
+
+        [WIN] Correct DeleteObject usage in PasteboardWin
+        https://bugs.webkit.org/show_bug.cgi?id=41956
+
+        Call DeleteObject() if OpenClipboard() fails and don't
+        call DeleteObject() on objects returned from SelectObject().
+
+        * platform/win/PasteboardWin.cpp:
+        (WebCore::Pasteboard::writeImage):
+
 2010-07-22  Lucas De Marchi  <lucas.demarchi at profusion.mobi>
 
         Reviewed by Antonio Gomes.
diff --git a/WebCore/platform/win/PasteboardWin.cpp b/WebCore/platform/win/PasteboardWin.cpp
index 808c863..169f6fd 100644
--- a/WebCore/platform/win/PasteboardWin.cpp
+++ b/WebCore/platform/win/PasteboardWin.cpp
@@ -216,31 +216,29 @@ void Pasteboard::writeImage(Node* node, const KURL&, const String&)
     HDC dc = GetDC(0);
     HDC compatibleDC = CreateCompatibleDC(0);
     HDC sourceDC = CreateCompatibleDC(0);
-    HBITMAP resultBitmap = CreateCompatibleBitmap(dc, image->width(), image->height());
-    HBITMAP oldBitmap = (HBITMAP)SelectObject(compatibleDC, resultBitmap);
+    OwnPtr<HBITMAP> resultBitmap(CreateCompatibleBitmap(dc, image->width(), image->height()));
+    HGDIOBJ oldBitmap = SelectObject(compatibleDC, resultBitmap.get());
 
     BitmapInfo bmInfo = BitmapInfo::create(image->size());
 
     HBITMAP coreBitmap = CreateDIBSection(dc, &bmInfo, DIB_RGB_COLORS, 0, 0, 0);
-    HBITMAP oldSource = (HBITMAP)SelectObject(sourceDC, coreBitmap);
+    HGDIOBJ oldSource = SelectObject(sourceDC, coreBitmap);
     image->getHBITMAP(coreBitmap);
 
     BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA};
     AlphaBlend(compatibleDC, 0, 0, image->width(), image->height(),
         sourceDC, 0, 0, image->width(), image->height(), bf);
 
-    SelectObject(compatibleDC, oldBitmap);
     SelectObject(sourceDC, oldSource);
-
-    DeleteObject(oldBitmap);
-    DeleteObject(oldSource);
     DeleteObject(coreBitmap);
-    ReleaseDC(0, dc);
-    DeleteDC(compatibleDC);
+
+    SelectObject(compatibleDC, oldBitmap);
     DeleteDC(sourceDC);
+    DeleteDC(compatibleDC);
+    ReleaseDC(0, dc);
 
     if (::OpenClipboard(m_owner)) {
-        ::SetClipboardData(CF_BITMAP, resultBitmap);
+        ::SetClipboardData(CF_BITMAP, resultBitmap.leakPtr());
         ::CloseClipboard();
     }
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list