mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[PR #682] [MERGED] Fix "unowned self" that can cause crash #720
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#720
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/OAuthSwift/OAuthSwift/pull/682
Author: @MarkJerde
Created: 11/9/2021
Status: ✅ Merged
Merged: 12/3/2021
Merged by: @phimage
Base:
master← Head:fix_unowned_self📝 Commits (1)
d2dc4cdFix unowned self📊 Changes
1 file changed (+2 additions, -2 deletions)
View changed files
📝
Sources/Handler/OAuthWebViewController.swift(+2 -2)📄 Description
With an
unowned selfthe reference to self can become nil without the ability for the code to be aware. As such,unowned selfshould be used when we know something else is guaranteed to retain a reference to our self. In this case there is no such guarantee. Fortunately, we can use aweak selfto have nullability safety here without any performanceconcerns.
This was noticed when it caused a crash in our app due to a particular series of events which resulted in this getting called after we had already gotten rid of the OAuthWebViewController.
Thank you, and thanks for OAuthSwift!
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.