File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -330,6 +330,8 @@ namespace Aws
330
330
331
331
private:
332
332
333
+ void CleanupDownloadStream ();
334
+
333
335
bool m_isMultipart;
334
336
Aws::String m_multipartId;
335
337
TransferDirection m_direction;
Original file line number Diff line number Diff line change @@ -113,11 +113,7 @@ namespace Aws
113
113
114
114
TransferHandle::~TransferHandle ()
115
115
{
116
- if (m_downloadStream)
117
- {
118
- Aws::Delete (m_downloadStream);
119
- m_downloadStream = nullptr ;
120
- }
116
+ CleanupDownloadStream ();
121
117
}
122
118
123
119
void TransferHandle::ChangePartToCompleted (const PartPointer& partState, const Aws::String &eTag)
@@ -237,11 +233,9 @@ namespace Aws
237
233
238
234
if (IsFinishedStatus (value))
239
235
{
240
- if (m_downloadStream && value == TransferStatus::COMPLETED)
236
+ if (value == TransferStatus::COMPLETED)
241
237
{
242
- m_downloadStream->flush ();
243
- Aws::Delete (m_downloadStream);
244
- m_downloadStream = nullptr ;
238
+ CleanupDownloadStream ();
245
239
}
246
240
247
241
std::unique_lock<std::mutex> semaphoreLock (m_statusLock);
@@ -296,5 +290,15 @@ namespace Aws
296
290
{
297
291
SetVersionId (downloadConfig.versionId );
298
292
}
293
+
294
+ void TransferHandle::CleanupDownloadStream ()
295
+ {
296
+ if (m_downloadStream)
297
+ {
298
+ m_downloadStream->flush ();
299
+ Aws::Delete (m_downloadStream);
300
+ m_downloadStream = nullptr ;
301
+ }
302
+ }
299
303
}
300
304
}
You can’t perform that action at this time.
0 commit comments