Title: [207103] releases/WebKitGTK/webkit-2.14/Source
Revision
207103
Author
[email protected]
Date
2016-10-11 05:32:47 -0700 (Tue, 11 Oct 2016)

Log Message

Merge r206377 - std::unique_ptr deleter functions should not check if pointer is null
https://bugs.webkit.org/show_bug.cgi?id=162558

Reviewed by Alex Christensen.

std::unique_ptr already does this before calling the deleter.

Source/WebCore:

* platform/graphics/x11/XUniquePtr.h:
(WebCore::XPtrDeleter::operator()):
(WebCore::XPtrDeleter<XImage>::operator()):
(WebCore::XPtrDeleter<_XGC>::operator()):
(WebCore::XPtrDeleter<__GLXcontextRec>::operator()):

Source/WTF:

* wtf/efl/UniquePtrEfl.h:
* wtf/glib/GUniquePtr.h:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.14/Source/WTF/ChangeLog (207102 => 207103)


--- releases/WebKitGTK/webkit-2.14/Source/WTF/ChangeLog	2016-10-11 12:11:49 UTC (rev 207102)
+++ releases/WebKitGTK/webkit-2.14/Source/WTF/ChangeLog	2016-10-11 12:32:47 UTC (rev 207103)
@@ -1,3 +1,15 @@
+2016-09-26  Michael Catanzaro  <[email protected]>
+
+        std::unique_ptr deleter functions should not check if pointer is null
+        https://bugs.webkit.org/show_bug.cgi?id=162558
+
+        Reviewed by Alex Christensen.
+
+        std::unique_ptr already does this before calling the deleter.
+
+        * wtf/efl/UniquePtrEfl.h:
+        * wtf/glib/GUniquePtr.h:
+
 2016-09-23  Carlos Garcia Campos  <[email protected]>
 
         REGRESSION(r194387): Crash on github.com in IntlDateTimeFormat::resolvedOptions in C locale

Modified: releases/WebKitGTK/webkit-2.14/Source/WTF/wtf/efl/UniquePtrEfl.h (207102 => 207103)


--- releases/WebKitGTK/webkit-2.14/Source/WTF/wtf/efl/UniquePtrEfl.h	2016-10-11 12:11:49 UTC (rev 207102)
+++ releases/WebKitGTK/webkit-2.14/Source/WTF/wtf/efl/UniquePtrEfl.h	2016-10-11 12:32:47 UTC (rev 207103)
@@ -54,8 +54,7 @@
     { \
         void operator() (typeName* ptr) const \
         { \
-            if (ptr) \
-                deleterFunc(ptr); \
+            deleterFunc(ptr); \
         } \
     };
 

Modified: releases/WebKitGTK/webkit-2.14/Source/WTF/wtf/glib/GUniquePtr.h (207102 => 207103)


--- releases/WebKitGTK/webkit-2.14/Source/WTF/wtf/glib/GUniquePtr.h	2016-10-11 12:11:49 UTC (rev 207102)
+++ releases/WebKitGTK/webkit-2.14/Source/WTF/wtf/glib/GUniquePtr.h	2016-10-11 12:32:47 UTC (rev 207103)
@@ -52,8 +52,7 @@
     { \
         void operator() (typeName* ptr) const \
         { \
-            if (ptr) \
-                deleterFunc(ptr); \
+            deleterFunc(ptr); \
         } \
     };
 

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (207102 => 207103)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog	2016-10-11 12:11:49 UTC (rev 207102)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog	2016-10-11 12:32:47 UTC (rev 207103)
@@ -1,5 +1,20 @@
 2016-09-26  Michael Catanzaro  <[email protected]>
 
+        std::unique_ptr deleter functions should not check if pointer is null
+        https://bugs.webkit.org/show_bug.cgi?id=162558
+
+        Reviewed by Alex Christensen.
+
+        std::unique_ptr already does this before calling the deleter.
+
+        * platform/graphics/x11/XUniquePtr.h:
+        (WebCore::XPtrDeleter::operator()):
+        (WebCore::XPtrDeleter<XImage>::operator()):
+        (WebCore::XPtrDeleter<_XGC>::operator()):
+        (WebCore::XPtrDeleter<__GLXcontextRec>::operator()):
+
+2016-09-26  Michael Catanzaro  <[email protected]>
+
         [GTK] Unnecessary extern functions in FontPlatformDataFreeType.cpp
         https://bugs.webkit.org/show_bug.cgi?id=162555
 

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/x11/XUniquePtr.h (207102 => 207103)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/x11/XUniquePtr.h	2016-10-11 12:11:49 UTC (rev 207102)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/x11/XUniquePtr.h	2016-10-11 12:32:47 UTC (rev 207103)
@@ -41,8 +41,7 @@
 struct XPtrDeleter {
     void operator()(T* ptr) const
     {
-        if (ptr)
-            XFree(ptr);
+        XFree(ptr);
     }
 };
 
@@ -52,8 +51,7 @@
 template<> struct XPtrDeleter<XImage> {
     void operator() (XImage* ptr) const
     {
-        if (ptr)
-            XDestroyImage(ptr);
+        XDestroyImage(ptr);
     }
 };
 
@@ -60,8 +58,7 @@
 template<> struct XPtrDeleter<_XGC> {
     void operator() (_XGC* ptr) const
     {
-        if (ptr)
-            XFreeGC(downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()).native(), ptr);
+        XFreeGC(downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()).native(), ptr);
     }
 };
 // Give a name to this to avoid having to use the internal struct name.
@@ -71,8 +68,7 @@
 template<> struct XPtrDeleter<__GLXcontextRec> {
     void operator() (__GLXcontextRec* ptr)
     {
-        if (ptr)
-            glXDestroyContext(downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()).native(), ptr);
+        glXDestroyContext(downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()).native(), ptr);
     }
 };
 // Give a name to this to avoid having to use the internal struct name.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to