Fix a leak pointed out by Alexey
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Nov 2007 07:29:36 +0000 (07:29 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Nov 2007 07:29:36 +0000 (07:29 +0000)
        * WebView.cpp:
        (getUpdateRects): Use a Vector<unsigned char>, since OwnPtr doesn't
        know to call delete[].

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28038 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/win/ChangeLog
WebKit/win/WebView.cpp

index 3d5788cd7bbe76649569dc7112d5c45f8f2dac3e..4f073380b01fc9e8037d2f51468123af3cf251be 100644 (file)
@@ -1,3 +1,11 @@
+2007-11-25  Adam Roben  <aroben@apple.com>
+
+        Fix a leak pointed out by Alexey
+
+        * WebView.cpp:
+        (getUpdateRects): Use a Vector<unsigned char>, since OwnPtr doesn't
+        know to call delete[].
+
 2007-11-25  Adam Roben  <aroben@apple.com>
 
         Fix Bug 16138: Reduce code duplication in WebView.cpp
index 9852a070c87d05de885fa5f254f044671097cc1c..0caa7e9555b49f52075b56b52b69fe6c209a6ea5 100644 (file)
@@ -721,8 +721,8 @@ static void getUpdateRects(HRGN region, const IntRect& dirtyRect, Vector<IntRect
         return;
     }
 
-    OwnPtr<unsigned char> buffer(new unsigned char[regionDataSize]);
-    RGNDATA* regionData = reinterpret_cast<RGNDATA*>(buffer.get());
+    Vector<unsigned char> buffer(regionDataSize);
+    RGNDATA* regionData = reinterpret_cast<RGNDATA*>(buffer.data());
     GetRegionData(region, regionDataSize, regionData);
     if (regionData->rdh.nCount > cRectThreshold) {
         rects.append(dirtyRect);