File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Sources/Segment/Plugins/Platforms/iOS Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -190,14 +190,15 @@ extension SegmentDestination.UploadTaskInfo {
190190 self . task = task
191191
192192 if let application = UIApplication . safeShared {
193- let taskIdentifier = application. beginBackgroundTask { [ self ] in
194- self . task. cancel ( )
195- self . cleanup ? ( )
193+ var taskIdentifier : UIBackgroundTaskIdentifier = . invalid
194+ taskIdentifier = application. beginBackgroundTask {
195+ task. cancel ( )
196+ application. endBackgroundTask ( taskIdentifier)
196197 }
197198 self . taskID = taskIdentifier. rawValue
198199
199- self . cleanup = { [ self ] in
200- application. endBackgroundTask ( UIBackgroundTaskIdentifier ( rawValue : self . taskID ) )
200+ self . cleanup = {
201+ application. endBackgroundTask ( taskIdentifier )
201202 }
202203 }
203204 }
You can’t perform that action at this time.
0 commit comments