Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b4cd8f1 authored by Jiyong Park's avatar Jiyong Park Committed by Automerger Merge Worker
Browse files

Merge "Allow SharedRefBase::make to use the deprecated new operator" am:...

Merge "Allow SharedRefBase::make to use the deprecated new operator" am: 5d4406c9 am: 5a32283a am: 2b7134e3

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1640146

Change-Id: I88280534d752cd7837a31359018c80e28eeeb551
parents 4f4734e1 2b7134e3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -82,7 +82,10 @@ class SharedRefBase {
     */
    template <class T, class... Args>
    static std::shared_ptr<T> make(Args&&... args) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        T* t = new T(std::forward<Args>(args)...);
#pragma clang diagnostic pop
        // warning: Potential leak of memory pointed to by 't' [clang-analyzer-unix.Malloc]
        return t->template ref<T>();  // NOLINT(clang-analyzer-unix.Malloc)
    }