diff --git a/services/screenclient/include/screen_client.h b/services/screenclient/include/screen_client.h index 3f0d9fe61ab3172317ec0465ae544999d443c270..bf0dc4a8a1ba22c759329ca82337b2354d2a70bb 100644 --- a/services/screenclient/include/screen_client.h +++ b/services/screenclient/include/screen_client.h @@ -35,7 +35,7 @@ namespace DistributedHardware { class ScreenClient { DECLARE_SINGLE_INSTANCE_BASE(ScreenClient); public: - int32_t AddWindow(std::shared_ptr windowProperty); + int32_t AddWindow(std::shared_ptr &windowProperty); sptr GetSurface(int32_t windowId); int32_t ShowWindow(int32_t windowId); int32_t MoveWindow(int32_t windowId, int32_t startX, int32_t startY); diff --git a/services/screenclient/include/screen_client_window_adapter.h b/services/screenclient/include/screen_client_window_adapter.h index 267a4264fda4b7d1a4e9c4556ae6c5e3fa696cc2..9b8d2300cbe6a6eb1dd6bd848b973d577c0501d9 100644 --- a/services/screenclient/include/screen_client_window_adapter.h +++ b/services/screenclient/include/screen_client_window_adapter.h @@ -37,7 +37,7 @@ namespace DistributedHardware { class ScreenClientWindowAdapter { DECLARE_SINGLE_INSTANCE_BASE(ScreenClientWindowAdapter); public: - sptr CreateWindow(std::shared_ptr windowProperty, int32_t windowId); + sptr CreateWindow(std::shared_ptr &windowProperty, int32_t windowId); int32_t ShowWindow(int32_t windowId); int32_t HideWindow(int32_t windowId); int32_t MoveWindow(int32_t windowId, int32_t startX, int32_t startY); diff --git a/services/screenclient/src/screen_client.cpp b/services/screenclient/src/screen_client.cpp index e373383fcff5cd16a501573f8b024351f9a18969..768c5c5c1343ec3d498399860fbe369c0407d7fe 100644 --- a/services/screenclient/src/screen_client.cpp +++ b/services/screenclient/src/screen_client.cpp @@ -22,7 +22,7 @@ namespace OHOS { namespace DistributedHardware { IMPLEMENT_SINGLE_INSTANCE(ScreenClient); -int32_t ScreenClient::AddWindow(std::shared_ptr windowProperty) +int32_t ScreenClient::AddWindow(std::shared_ptr &windowProperty) { if (windowProperty == nullptr) { DHLOGE("windowProperty is nullptr."); diff --git a/services/screenclient/src/screen_client_window_adapter.cpp b/services/screenclient/src/screen_client_window_adapter.cpp index 043832332892cbf99d1567ee65805c1d68c8a186..a00da85a1675ae9f6163b51c2e1daeff7374caf7 100644 --- a/services/screenclient/src/screen_client_window_adapter.cpp +++ b/services/screenclient/src/screen_client_window_adapter.cpp @@ -28,7 +28,7 @@ namespace OHOS { namespace DistributedHardware { IMPLEMENT_SINGLE_INSTANCE(ScreenClientWindowAdapter); -sptr ScreenClientWindowAdapter::CreateWindow(std::shared_ptr windowProperty, +sptr ScreenClientWindowAdapter::CreateWindow(std::shared_ptr &windowProperty, int32_t windowId) { if (windowProperty == nullptr) {