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