| 3606 | } |
| 3607 | |
| 3608 | Status FinalizeS3() { |
| 3609 | auto instance = GetAwsInstance(); |
| 3610 | // The AWS instance might already be destroyed in case FinalizeS3 |
| 3611 | // is called from an atexit handler (which is a bad idea anyway as the |
| 3612 | // AWS SDK is not safe anymore to shutdown by this time). See GH-44071. |
| 3613 | if (instance == nullptr) { |
| 3614 | return Status::Invalid("FinalizeS3 called too late"); |
| 3615 | } |
| 3616 | instance->Finalize(); |
| 3617 | return Status::OK(); |
| 3618 | } |
| 3619 | |
| 3620 | Status EnsureS3Finalized() { return FinalizeS3(); } |
| 3621 | |