From 9f8c8d2a3546f50b50c38744bd13f0154495f91d Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Fri, 19 Apr 2024 11:25:16 -0700 Subject: [PATCH 1/4] Move the usage of the const char* path into the original thread. --- storage/src/ios/storage_reference_ios.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { From b3ba59daa55134cdc9dd8015e9f443c9390209e8 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Fri, 19 Apr 2024 11:28:31 -0700 Subject: [PATCH 2/4] Add readme. --- release_build_files/readme.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 0239ebec99..303d1d8a7e 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -631,6 +631,11 @@ 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 `GetFile()` when running in a + secondary thread. + ### 11.10.0 - Changes - General (Android): Update to Firebase Android BoM version 32.8.1. From fb9096fc40ff6507df832b0af4b61813843468f3 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Fri, 19 Apr 2024 11:29:56 -0700 Subject: [PATCH 3/4] Add link to issue. --- release_build_files/readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 303d1d8a7e..86068a387f 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -634,7 +634,8 @@ code. ### Upcoming Release - Changes - Storage (iOS): Fix invalid pointer in `GetFile()` when running in a - secondary thread. + secondary thread + ([#1570](https://github.com/firebase/firebase-cpp-sdk/issues/1570)). ### 11.10.0 - Changes From eb20def6ca3e542af606c0b8e2357d2bc79f5698 Mon Sep 17 00:00:00 2001 From: Jon Simantov Date: Fri, 19 Apr 2024 15:54:36 -0700 Subject: [PATCH 4/4] Add namespace to readme note. --- release_build_files/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 86068a387f..8f78b964bf 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -633,8 +633,8 @@ code. ## Release Notes ### Upcoming Release - Changes - - Storage (iOS): Fix invalid pointer in `GetFile()` when running in a - secondary thread + - 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