diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 0239ebec99..8f78b964bf 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -631,6 +631,12 @@ workflow use only during the development of your app, not for publicly shipping code. ## Release Notes +### Upcoming Release +- Changes + - Storage (iOS): Fix invalid pointer in `StorageReference::GetFile()` when + running in a secondary thread + ([#1570](https://github.com/firebase/firebase-cpp-sdk/issues/1570)). + ### 11.10.0 - Changes - General (Android): Update to Firebase Android BoM version 32.8.1. diff --git a/storage/src/ios/storage_reference_ios.mm b/storage/src/ios/storage_reference_ios.mm index 3696693140..d2260e3416 100644 --- a/storage/src/ios/storage_reference_ios.mm +++ b/storage/src/ios/storage_reference_ios.mm @@ -142,11 +142,12 @@ // Cache a copy of the impl and storage, in case this is destroyed before the thread runs. FIRStorageReference* my_impl = impl(); StorageInternal* storage = storage_; + NSURL* local_file_url = [NSURL URLWithString:@(path)]; util::DispatchAsyncSafeMainQueue(^() { FIRStorageDownloadTask *download_task; { MutexLock mutex(controller_init_mutex_); - download_task = [my_impl writeToFile:[NSURL URLWithString:@(path)] completion:completion]; + download_task = [my_impl writeToFile:local_file_url completion:completion]; local_controller->AssignTask(storage, download_task); } if (listener) {