Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit 58b2061

Browse files
ShippyMSFTvinjiang
authored andcommitted
Fix possible unobserved exception
If buffer_task throws and provider.close() throws, it will lead to an unobserved exception error. Retrieve the buffer_task result first to avoid this.
1 parent 154065f commit 58b2061

File tree

1 file changed

+2
-1
lines changed
  • Microsoft.WindowsAzure.Storage/includes/wascore

1 file changed

+2
-1
lines changed

Microsoft.WindowsAzure.Storage/includes/wascore/executor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ namespace azure { namespace storage { namespace core {
8383

8484
return stream_copy_async(stream, temp_stream, length, max_length, cancellation_token).then([temp_buffer, provider] (pplx::task<utility::size64_t> buffer_task) mutable -> istream_descriptor
8585
{
86+
auto length = buffer_task.get();
8687
provider.close();
87-
return istream_descriptor(concurrency::streams::container_stream<std::vector<uint8_t>>::open_istream(temp_buffer.collection()), buffer_task.get(), provider.hash());
88+
return istream_descriptor(concurrency::streams::container_stream<std::vector<uint8_t>>::open_istream(temp_buffer.collection()), length, provider.hash());
8889
});
8990
}
9091

0 commit comments

Comments
 (0)