Changeset 206377 in webkit


Ignore:
Timestamp:
Sep 26, 2016 9:40:38 AM (8 years ago)
Author:
Michael Catanzaro
Message:

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:
Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r206372 r206377  
     12016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        std::unique_ptr deleter functions should not check if pointer is null
     4        https://bugs.webkit.org/show_bug.cgi?id=162558
     5
     6        Reviewed by Alex Christensen.
     7
     8        std::unique_ptr already does this before calling the deleter.
     9
     10        * wtf/efl/UniquePtrEfl.h:
     11        * wtf/glib/GUniquePtr.h:
     12
    113== Rolled over to ChangeLog-2016-09-26 ==
  • trunk/Source/WTF/wtf/efl/UniquePtrEfl.h

    r184554 r206377  
    5555        void operator() (typeName* ptr) const \
    5656        { \
    57             if (ptr) \
    58                 deleterFunc(ptr); \
     57            deleterFunc(ptr); \
    5958        } \
    6059    };
  • trunk/Source/WTF/wtf/glib/GUniquePtr.h

    r194579 r206377  
    5353        void operator() (typeName* ptr) const \
    5454        { \
    55             if (ptr) \
    56                 deleterFunc(ptr); \
     55            deleterFunc(ptr); \
    5756        } \
    5857    };
  • trunk/Source/WebCore/ChangeLog

    r206375 r206377  
     12016-09-26  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        std::unique_ptr deleter functions should not check if pointer is null
     4        https://bugs.webkit.org/show_bug.cgi?id=162558
     5
     6        Reviewed by Alex Christensen.
     7
     8        std::unique_ptr already does this before calling the deleter.
     9
     10        * platform/graphics/x11/XUniquePtr.h:
     11        (WebCore::XPtrDeleter::operator()):
     12        (WebCore::XPtrDeleter<XImage>::operator()):
     13        (WebCore::XPtrDeleter<_XGC>::operator()):
     14        (WebCore::XPtrDeleter<__GLXcontextRec>::operator()):
     15
    1162016-09-26  Per Arne Vollan  <pvollan@apple.com>
    217
  • trunk/Source/WebCore/platform/graphics/x11/XUniquePtr.h

    r184197 r206377  
    4242    void operator()(T* ptr) const
    4343    {
    44         if (ptr)
    45             XFree(ptr);
     44        XFree(ptr);
    4645    }
    4746};
     
    5352    void operator() (XImage* ptr) const
    5453    {
    55         if (ptr)
    56             XDestroyImage(ptr);
     54        XDestroyImage(ptr);
    5755    }
    5856};
     
    6159    void operator() (_XGC* ptr) const
    6260    {
    63         if (ptr)
    64             XFreeGC(downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()).native(), ptr);
     61        XFreeGC(downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()).native(), ptr);
    6562    }
    6663};
     
    7269    void operator() (__GLXcontextRec* ptr)
    7370    {
    74         if (ptr)
    75             glXDestroyContext(downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()).native(), ptr);
     71        glXDestroyContext(downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay()).native(), ptr);
    7672    }
    7773};
Note: See TracChangeset for help on using the changeset viewer.