From 99b4c86c39ca8f402a3fda1595b0fb9265d522b2 Mon Sep 17 00:00:00 2001 From: yuwenze Date: Tue, 7 Mar 2023 06:40:58 +0000 Subject: [PATCH] fixed crash Signed-off-by: yuwenze Change-Id: If09ec0199c05600bbfd00323ad55e1fd5925ee00 --- .../native/ability/native/data_ability_helper.cpp | 14 +++++++------- .../native/ability/native/data_ability_helper.h | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/frameworks/native/ability/native/data_ability_helper.cpp b/frameworks/native/ability/native/data_ability_helper.cpp index 7672769a86d..a1932863bc1 100644 --- a/frameworks/native/ability/native/data_ability_helper.cpp +++ b/frameworks/native/ability/native/data_ability_helper.cpp @@ -40,7 +40,7 @@ DataAbilityHelper::DataAbilityHelper(const std::shared_ptr DataAbilityHelper::Creator(const std::shared_ptr &context) +std::shared_ptr DataAbilityHelper::Creator(const std::shared_ptr context) { HILOG_INFO("Call DataAbilityHelperImpl Creator with context."); DataAbilityHelper *ptrDataAbilityHelper = nullptr; @@ -60,7 +60,7 @@ std::shared_ptr DataAbilityHelper::Creator(const std::shared_ * @return Returns the created DataAbilityHelper instance with a specified Uri. */ std::shared_ptr DataAbilityHelper::Creator( - const std::shared_ptr &context, const std::shared_ptr &uri) + const std::shared_ptr context, const std::shared_ptr &uri) { HILOG_INFO("Call DataAbilityHelperImpl Creator with context & uri."); if (!context || !uri) { @@ -94,7 +94,7 @@ std::shared_ptr DataAbilityHelper::Creator( * @return Returns the created DataAbilityHelper instance with a specified Uri. */ std::shared_ptr DataAbilityHelper::Creator( - const std::shared_ptr &context, const std::shared_ptr &uri) + const std::shared_ptr context, const std::shared_ptr &uri) { HILOG_INFO("Call DataAbilityHelperImpl Creator with ability runtime context & uri."); if (!context || !uri) { @@ -133,7 +133,7 @@ std::shared_ptr DataAbilityHelper::Creator( * @return Returns the created DataAbilityHelper instance. */ std::shared_ptr DataAbilityHelper::Creator( - const std::shared_ptr &context, const std::shared_ptr &uri, const bool tryBind) + const std::shared_ptr context, const std::shared_ptr &uri, const bool tryBind) { HILOG_INFO("Call DataAbilityHelperImpl Creator with context & uri & tryBind."); DataAbilityHelper *ptrDataAbilityHelper = nullptr; @@ -157,7 +157,7 @@ std::shared_ptr DataAbilityHelper::Creator( * @return Returns the created DataAbilityHelper instance. */ std::shared_ptr DataAbilityHelper::Creator( - const std::shared_ptr &context, const std::shared_ptr &uri, const bool tryBind) + const std::shared_ptr context, const std::shared_ptr &uri, const bool tryBind) { HILOG_INFO("Call DataAbilityHelperImpl Creator with ability runtime context & uri & tryBind."); DataAbilityHelper *ptrDataAbilityHelper = nullptr; @@ -175,7 +175,7 @@ std::shared_ptr DataAbilityHelper::Creator( * * @return Returns the created DataAbilityHelper instance where Uri is not specified. */ -std::shared_ptr DataAbilityHelper::Creator(const sptr &token) +std::shared_ptr DataAbilityHelper::Creator(const sptr token) { HILOG_INFO("Call DataAbilityHelperImpl Creator with token."); DataAbilityHelper *ptrDataAbilityHelper = nullptr; @@ -197,7 +197,7 @@ std::shared_ptr DataAbilityHelper::Creator(const sptr DataAbilityHelper::Creator( - const sptr &token, const std::shared_ptr &uri) + const sptr token, const std::shared_ptr &uri) { HILOG_INFO("Call DataAbilityHelperImpl Creator with token & uri."); if (!token || !uri) { diff --git a/interfaces/kits/native/ability/native/data_ability_helper.h b/interfaces/kits/native/ability/native/data_ability_helper.h index a9d839d6083..405b7f6baf6 100644 --- a/interfaces/kits/native/ability/native/data_ability_helper.h +++ b/interfaces/kits/native/ability/native/data_ability_helper.h @@ -34,7 +34,7 @@ public: * * @return Returns the created DataAbilityHelper instance where Uri is not specified. */ - static std::shared_ptr Creator(const std::shared_ptr &context); + static std::shared_ptr Creator(const std::shared_ptr context); /** * @brief Creates a DataAbilityHelper instance with the Uri specified based on the given Context. @@ -45,7 +45,7 @@ public: * @return Returns the created DataAbilityHelper instance with a specified Uri. */ static std::shared_ptr Creator( - const std::shared_ptr &context, const std::shared_ptr &uri); + const std::shared_ptr context, const std::shared_ptr &uri); /** * @brief Creates a DataAbilityHelper instance with the Uri specified based on the given Context. @@ -56,7 +56,7 @@ public: * @return Returns the created DataAbilityHelper instance with a specified Uri. */ static std::shared_ptr Creator( - const std::shared_ptr &context, const std::shared_ptr &uri); + const std::shared_ptr context, const std::shared_ptr &uri); /** * @brief You can use this method to specify the Uri of the data to operate and set the binding relationship @@ -71,7 +71,7 @@ public: * @return Returns the created DataAbilityHelper instance. */ static std::shared_ptr Creator( - const std::shared_ptr &context, const std::shared_ptr &uri, const bool tryBind); + const std::shared_ptr context, const std::shared_ptr &uri, const bool tryBind); /** * @brief You can use this method to specify the Uri of the data to operate and set the binding relationship @@ -85,7 +85,7 @@ public: * * @return Returns the created DataAbilityHelper instance. */ - static std::shared_ptr Creator(const std::shared_ptr &context, + static std::shared_ptr Creator(const std::shared_ptr context, const std::shared_ptr &uri, const bool tryBind); /** @@ -95,7 +95,7 @@ public: * * @return Returns the created DataAbilityHelper instance where Uri is not specified. */ - static std::shared_ptr Creator(const sptr &token); + static std::shared_ptr Creator(const sptr token); /** * @brief You can use this method to specify the Uri of the data to operate and set the binding relationship @@ -108,7 +108,7 @@ public: * @return Returns the created DataAbilityHelper instance. */ static std::shared_ptr Creator( - const sptr &token, const std::shared_ptr &uri); + const sptr token, const std::shared_ptr &uri); /** * @brief Releases the client resource of the Data ability. -- Gitee