Skip to content

Commit

Permalink
change client_ to shared_ptr type
Browse files Browse the repository at this point in the history
  • Loading branch information
huiguangjun committed May 25, 2019
1 parent 5b71310 commit ee12a0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sdk/include/alibabacloud/oss/OssClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ namespace OSS
void DisableRequest();
void EnableRequest();
private:
OssClientImpl *client_;
std::shared_ptr<OssClientImpl> client_;
};
}
}
6 changes: 1 addition & 5 deletions sdk/src/OssClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,12 @@ OssClient::OssClient(const std::string &endpoint, const Credentials &credentials
}

OssClient::OssClient(const std::string &endpoint, const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
client_(new OssClientImpl(endpoint, credentialsProvider, configuration))
client_(std::make_shared<OssClientImpl>(endpoint, credentialsProvider, configuration))
{
}

OssClient::~OssClient()
{
if (client_) {
delete client_;
}
client_ = nullptr;
}

ListBucketsOutcome OssClient::ListBuckets() const
Expand Down

0 comments on commit ee12a0b

Please sign in to comment.