【发布时间】:2022-12-15 02:27:52
【问题描述】:
更新后我遇到问题:使用 AWS SDK 将对象上传到 Amazon S3 存储桶:(https://docs.aws.amazon.com/AmazonS3/latest/userguide/example_s3_PutObject_section.html)
int main(int, char **)
{
Aws::SDKOptions options;
classB::initAwsApi(options);
while (true)
{
//...
if (threadApi.joinable())
threadApi.join();
threadApi = std::thread(request, &connection, &headers);
std::this_thread::sleep_for(std::chrono::seconds(5));
// if I close the stream, the error doesn't appear. But I would like to close the stream
stream_.release();
}
if (threadApi.joinable())
threadApi.join();
// when closing the SDK, the error appears
classB::shutdownAwsApi(options);
}
输出: /home/x/x/deps/aws-sdk-cpp/crt/aws-crt-cpp/crt/aws-c-common/source/allocator.c:209: allocator != ((void *)0) 退出应用程序 没有可用的调用堆栈信息 中止(核心转储)
【问题讨论】:
标签: amazon-web-services aws-sdk aws-sdk-cpp