Skip to content
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

Fix crash on media upload #859

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

j-f1
Copy link
Contributor

@j-f1 j-f1 commented Jan 5, 2023

May fix #782.

Using the information linked by @kenji21 (Thank you so much for the pointer), I noticed that the OutputStream of SerialStream has its delegate set, but the delegate is never unset. OutputStream does indeed mark its delegate as unowned(unsafe) so this is likely the cause of the crash. I have not however tested this change since I haven’t seen the crash on my end.

I’m also a little concerned about the correctness of SerialStream. It’s not clear to me how long its lifetime is, and the fact that the crash occurred in at least one case “around 200kb/2.82MB” makes me worry that the SerialStream is being prematurely released. Not sure if there’s a good way to make sure it stays alive until the request is done.

@j-f1 j-f1 changed the title Attempt to fix crash on media upload Fix crash on media upload Feb 3, 2023
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.

App crashes when attempting to upload cat pic
2 participants