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: property memory annotations #146

Merged

Conversation

einsteinx2
Copy link
Contributor

Summary

This commit does 2 things.

First, it fixes a reported crash due to the MPAliasResponse NSString *errorResponse being marked as assign intead of copy (or strong), as well as fixing another potential instance of this that I found in MParticleOptions NSString *defaultAgent being marked as unsafe_unretained instead of copy (or strong). I changed both instances of this to copy.

Second, it removes all uses of the assign and unsafe_unretained memory annotations on value types, as that is the only valid option (strong and weak cannot be used for value types) and is the default anyway. Looking at Apple’s UIView.h for example, they omit them as well.

Testing Plan

Ran unit tests for iOS and tvOS. The changes are all trivial and other than compiling and tests passing should only require code review.

Master Issue

Closes https://go.mparticle.com/work/SQDSDKS-3660

This commit does 2 things.

First, it fixes a reported crash due to the MPAliasResponse NSString *errorResponse being marked as assign intead of copy (or strong), as well as fixing another potential instance of this that I found in MParticleOptions NSString *defaultAgent being marked as unsafe_unretained instead of copy (or strong). I changed both instances of this to copy.

Second, it removes all uses of the assign and unsafe_unretained memory annotations on value types, as that is the only valid option (strong and weak cannot be used for value types) and is the default anyway. Looking at Apple’s UIView.h for example, they omit them as well.
@einsteinx2 einsteinx2 merged commit f52f1b6 into development Apr 27, 2022
@einsteinx2 einsteinx2 deleted the fix/3660-string-property-assign-instead-of-copy branch April 27, 2022 17:59
einsteinx2 added a commit that referenced this pull request Apr 27, 2022
This commit does 2 things.

First, it fixes a reported crash due to the MPAliasResponse NSString *errorResponse being marked as assign intead of copy (or strong), as well as fixing another potential instance of this that I found in MParticleOptions NSString *defaultAgent being marked as unsafe_unretained instead of copy (or strong). I changed both instances of this to copy.

Second, it removes all uses of the assign and unsafe_unretained memory annotations on value types, as that is the only valid option (strong and weak cannot be used for value types) and is the default anyway. Looking at Apple’s UIView.h for example, they omit them as well.
einsteinx2 added a commit that referenced this pull request May 16, 2022
This commit does 2 things.

First, it fixes a reported crash due to the MPAliasResponse NSString *errorResponse being marked as assign intead of copy (or strong), as well as fixing another potential instance of this that I found in MParticleOptions NSString *defaultAgent being marked as unsafe_unretained instead of copy (or strong). I changed both instances of this to copy.

Second, it removes all uses of the assign and unsafe_unretained memory annotations on value types, as that is the only valid option (strong and weak cannot be used for value types) and is the default anyway. Looking at Apple’s UIView.h for example, they omit them as well.
einsteinx2 added a commit that referenced this pull request May 17, 2022
This commit does 2 things.

First, it fixes a reported crash due to the MPAliasResponse NSString *errorResponse being marked as assign intead of copy (or strong), as well as fixing another potential instance of this that I found in MParticleOptions NSString *defaultAgent being marked as unsafe_unretained instead of copy (or strong). I changed both instances of this to copy.

Second, it removes all uses of the assign and unsafe_unretained memory annotations on value types, as that is the only valid option (strong and weak cannot be used for value types) and is the default anyway. Looking at Apple’s UIView.h for example, they omit them as well.
mparticle-automation added a commit that referenced this pull request May 17, 2022
# [8.8.0](v8.7.0...v8.8.0) (2022-05-17)

### Bug Fixes

* Fix Dereferenced Garbage Pointer ([#148](#148)) ([d2c58e1](d2c58e1))
* property memory annotations ([#146](#146)) ([c95ddf6](c95ddf6))
* update active kits header ([#147](#147)) ([d196723](d196723))

### Features

* add conformsToProtocol forwarding to MPAppDelegateProxy ([#144](#144)) ([40e517a](40e517a))
* add support for client side rules ([#151](#151)) ([6a93096](6a93096))
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.

None yet

2 participants