diff --git a/frameworks/native/consumer/src/datashare_connection.cpp b/frameworks/native/consumer/src/datashare_connection.cpp index 1fd7eb3fb3081d5ac04ac0a3f39bb0c13d23ac20..aa0e323bc59b8ff87a7199cc6c5668a55d47dd7d 100644 --- a/frameworks/native/consumer/src/datashare_connection.cpp +++ b/frameworks/native/consumer/src/datashare_connection.cpp @@ -41,7 +41,7 @@ void DataShareConnection::OnAbilityConnectDone( return; } std::unique_lock lock(condition_.mutex); - SetDataShareProxy(iface_cast(remoteObject)); + SetDataShareProxy(new (std::nothrow) DataShareProxy(remoteObject)); condition_.condition.notify_all(); }