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 3d5788c..4f07338 100644 (file)
@@ -1,5 +1,13 @@
 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
 
         http://bugs.webkit.org/show_bug.cgi?id=16138
index 9852a07..0caa7e9 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);