Skip to content

Commit

Permalink
Setting NSKeyValueObservation to nil to avoid app crash
Browse files Browse the repository at this point in the history
  • Loading branch information
shridharav committed Nov 9, 2021
1 parent 2028917 commit ad50c9a
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ extension BGTaskProcessController {
self.completion = nil

self.keyValueObs?.invalidate()
self.keyValueObs = nil //otherwise app crashes incase this method gets called twice

//cancelling and suspending so that pending tasks won't resume.
operationQueue.cancelAllOperations()
Expand Down

0 comments on commit ad50c9a

Please sign in to comment.