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

[WPP-2267] Avoid HttpsCallableReference copy constructor #67

Merged
merged 1 commit into from
May 22, 2024

Conversation

darinf
Copy link

@darinf darinf commented May 22, 2024

Unfortunately HttpsCallableReference does not use internal reference counting, and as a result, we need to avoid the copy-constructor for HttpsCallableReference. Otherwise, if Swift creates a copy of the object and deletes that copy, it will result in any pending Call being interrupted or triggering memory corruption in the case that Call has not completed. To avoid this and to prevent Swift from seeing the copy constructor, wrap with a std::shared_ptr.

@darinf darinf requested a review from fiedukow May 22, 2024 19:44
@darinf darinf marked this pull request as ready for review May 22, 2024 19:44
@darinf darinf changed the title Avoid HttpsCallableReference copy constructor [WPP-2267] Avoid HttpsCallableReference copy constructor May 22, 2024
@darinf darinf marked this pull request as draft May 22, 2024 19:48
@darinf
Copy link
Author

darinf commented May 22, 2024

Making this a draft pending verification that this actually fixes the issue.

@darinf darinf marked this pull request as ready for review May 22, 2024 20:27
@darinf darinf merged commit 5579b7c into main May 22, 2024
2 checks passed
@darinf darinf deleted the darin/https-callable-ref branch May 22, 2024 20:44
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.

2 participants