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 {
190
190
self . task = task
191
191
192
192
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)
196
197
}
197
198
self . taskID = taskIdentifier. rawValue
198
199
199
- self . cleanup = { [ self ] in
200
- application. endBackgroundTask ( UIBackgroundTaskIdentifier ( rawValue : self . taskID ) )
200
+ self . cleanup = {
201
+ application. endBackgroundTask ( taskIdentifier )
201
202
}
202
203
}
203
204
}
You can’t perform that action at this time.
0 commit comments