Skip to content

Fix potential crash in #177 #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 1, 2022
Merged

Fix potential crash in #177 #178

merged 8 commits into from
Dec 1, 2022

Conversation

bsneed
Copy link
Contributor

@bsneed bsneed commented Nov 30, 2022

@@ -321,10 +321,11 @@ extension Storage {
let fileEnding = "],\"sentAt\":\"\(sentAt)\",\"writeKey\":\"\(writeKey)\"}"
do {
try outputStream.write(fileEnding)
try outputStream.close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance this should be in a finally block?

Copy link
Contributor Author

@bsneed bsneed Nov 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because it throws and we'd need to have another identical catch in the finally block. ... and it's all synchronous anyway.

@bsneed bsneed merged commit 9c4cb9b into main Dec 1, 2022
@bsneed bsneed deleted the bsneed/output_crash branch December 1, 2022 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crashes observed in OutputFileStream due to EXC_BAD_ACCESS.
3 participants