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(macos): crash when custom protocol response is empty #567

Merged
merged 1 commit into from
May 2, 2022

Conversation

lucasfernog
Copy link
Member

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

I found this crash in the streaming example (tauri repo). When the response is empty (e.g. return ResponseBuilder::new().mimetype("text/plain").status(404).body(Vec::new())), the app was crashing with this report:

streaming(13585,0x103b90580) malloc: *** error for object 0x1: pointer being freed was not allocated
streaming(13585,0x103b90580) malloc: *** set a breakpoint in malloc_error_break to debug

This change fixes it, setting freeWhenDone to NO if the response buffer is empty.

@lucasfernog lucasfernog requested a review from a team May 1, 2022 23:45
@lucasfernog lucasfernog requested a review from a team as a code owner May 1, 2022 23:45
@wusyong wusyong merged commit 67809f4 into dev May 2, 2022
@wusyong wusyong deleted the fix/macos-protocol-crash branch May 2, 2022 04:42
@github-actions github-actions bot mentioned this pull request May 2, 2022
@davidarroyo1234
Copy link

Turns out it was an empty css file

Thanks, now its opening in release mode..

(Using angular).

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.

3 participants