Provide details of the change, and generalize the change in the PR title above.
As reported in #1570, if StorageReference::GetFile() is called from a non-UI thread, the const char* path passed in is not preserved and could have been deleted by the calling code once the FIRStorage native call occurs in the main thread later.
Fix this by creating the URL from the local file path outside outside of the thread dispatch block. (Similar to what PutFile() already does.)
Testing
Describe how you've tested these changes. Link any manually triggered Integration tests or CPP binary SDK Packaging Github Action workflows, if applicable.
Integration tests in this PR.
Type of Change
Place an x the applicable box:
[x] Bug fix. Add the issue # below if applicable.
[ ] New feature. A non-breaking change which adds functionality.
[ ] Other, such as a build process or documentation change.
Notes
Bug fixes and feature changes require an update to the Release Notes section of release_build_files/readme.md.
Changes to the public API require an internal API review. If you'd like to help us make Firebase APIs better, please propose your change in a feature request so that we can discuss it together.
Description
As reported in #1570, if
StorageReference::GetFile()
is called from a non-UI thread, theconst char* path
passed in is not preserved and could have been deleted by the calling code once theFIRStorage
native call occurs in the main thread later.Fix this by creating the URL from the local file path outside outside of the thread dispatch block. (Similar to what
PutFile()
already does.)Testing
Integration tests in this PR.
Type of Change
Place an
x
the applicable box:Notes
Release Notes
section ofrelease_build_files/readme.md
.