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 dangling reference warning on assign object property #836

Merged
merged 1 commit into from
Oct 6, 2022

Conversation

tiwoc
Copy link
Contributor

@tiwoc tiwoc commented Oct 6, 2022

This doesn't change the behavior, it just makes the behavior explicit and silences this compiler warning when using FMDB in a project that has the -Wobjc-property-assign-on-object-type warning flag:

'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained'

The alternative would have been to make this a weak property, but this would have been a behavior change, and after reading the discussion #522, I gather that this is something that shouldn't be done in FMDB without bumping the major version number.

This doesn't change the behavior, it just silences this compiler warning
when using FMDB in a project that has the
-Wobjc-property-assign-on-object-type warning flag.

https://clang.llvm.org/docs/AutomaticReferenceCounting.html#property-declarations

The alternative would have been to make this a weak property, but this
would have been a behavior change, and after reading the discussion
ccgus#522, I gather that this is
something that shouldn't be done in FMDB without bumping the major
version number.
@lzcuriosity
Copy link

lzcuriosity commented Oct 6, 2022 via email

@ccgus ccgus merged commit 3e5ecb6 into ccgus:master Oct 6, 2022
@ccgus
Copy link
Owner

ccgus commented Oct 6, 2022

Thanks for doing this - it's merged!

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