From feadd70b93bb29d5c6c16ccda6e458170ba91d0d Mon Sep 17 00:00:00 2001 From: Ilya Erokhin Date: Wed, 27 Aug 2025 11:29:21 +0300 Subject: [PATCH] Change return value from std::shared_ptr to const std::shared_ptr& for PixelMapTaiheAni::GetNativePixelMap and PixelMapImpl::GetNativePtr Signed-off-by: Ilya Erokhin Change-Id: Ieda3d1cbc0f5c35a0b7f92cb345c84d956c26a16 --- frameworks/kits/taihe/include/pixel_map_taihe.h | 2 +- frameworks/kits/taihe/include/pixel_map_taihe_ani.h | 2 +- frameworks/kits/taihe/src/pixel_map_taihe.cpp | 2 +- frameworks/kits/taihe/src/pixel_map_taihe_ani.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frameworks/kits/taihe/include/pixel_map_taihe.h b/frameworks/kits/taihe/include/pixel_map_taihe.h index e4b64a83b..933739d28 100644 --- a/frameworks/kits/taihe/include/pixel_map_taihe.h +++ b/frameworks/kits/taihe/include/pixel_map_taihe.h @@ -36,7 +36,7 @@ public: ~PixelMapImpl(); int64_t GetImplPtr(); - std::shared_ptr GetNativePtr(); + const std::shared_ptr& GetNativePtr(); static std::shared_ptr GetPixelMap(PixelMap etsPixelMap); static PixelMap CreatePixelMap(std::shared_ptr pixelMap); diff --git a/frameworks/kits/taihe/include/pixel_map_taihe_ani.h b/frameworks/kits/taihe/include/pixel_map_taihe_ani.h index 2e7d5a3a0..9a6b3febb 100644 --- a/frameworks/kits/taihe/include/pixel_map_taihe_ani.h +++ b/frameworks/kits/taihe/include/pixel_map_taihe_ani.h @@ -27,7 +27,7 @@ namespace Media { class PixelMapTaiheAni { public: static ani_object CreateEtsPixelMap([[maybe_unused]] ani_env* env, std::shared_ptr pixelMap); - static std::shared_ptr GetNativePixelMap([[maybe_unused]] ani_env* env, ani_object obj); + static const std::shared_ptr& GetNativePixelMap([[maybe_unused]] ani_env* env, ani_object obj); std::shared_ptr nativePixelMap_; }; diff --git a/frameworks/kits/taihe/src/pixel_map_taihe.cpp b/frameworks/kits/taihe/src/pixel_map_taihe.cpp index cba0ec887..4ea3b3816 100644 --- a/frameworks/kits/taihe/src/pixel_map_taihe.cpp +++ b/frameworks/kits/taihe/src/pixel_map_taihe.cpp @@ -235,7 +235,7 @@ int64_t PixelMapImpl::GetImplPtr() return static_cast(reinterpret_cast(this)); } -std::shared_ptr PixelMapImpl::GetNativePtr() +const std::shared_ptr& PixelMapImpl::GetNativePtr() { return nativePixelMap_; } diff --git a/frameworks/kits/taihe/src/pixel_map_taihe_ani.cpp b/frameworks/kits/taihe/src/pixel_map_taihe_ani.cpp index 1b49217ff..856b6056a 100644 --- a/frameworks/kits/taihe/src/pixel_map_taihe_ani.cpp +++ b/frameworks/kits/taihe/src/pixel_map_taihe_ani.cpp @@ -49,7 +49,7 @@ ani_object PixelMapTaiheAni::CreateEtsPixelMap([[maybe_unused]] ani_env* env, st return reinterpret_cast(pixelMapObj); } -std::shared_ptr PixelMapTaiheAni::GetNativePixelMap([[maybe_unused]] ani_env* env, ani_object obj) +const std::shared_ptr& PixelMapTaiheAni::GetNativePixelMap([[maybe_unused]] ani_env* env, ani_object obj) { ani_signature::Type cls = ani_signature::Builder::BuildClass("@ohos.multimedia.image.image.PixelMap"); ani_class pixelMapCls; -- Gitee