Skip to content

Fix lastArchivePath, lastFilepath memory management#86

Merged
abbeycode merged 1 commit intoabbeycode:v2.10from
fillito:patch-1
Nov 26, 2019
Merged

Fix lastArchivePath, lastFilepath memory management#86
abbeycode merged 1 commit intoabbeycode:v2.10from
fillito:patch-1

Conversation

@fillito
Copy link
Contributor

@fillito fillito commented Nov 25, 2019

The project can't be archived due to -Wobjc-property-assign-on-object-type flagging a potential memory management error defining lastArchivePath and lastFilepath properties.

Both properties are defined as assign but they contain object references. A copy would probably work better in this case.

/Users/danielgarcia/.../Carthage/Checkouts/UnrarKit/Classes/URKArchive.mm:54:1: error: 'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained' [-Werror,-Wobjc-property-assign-on-object-type]
@property (assign) NSString *lastArchivePath;
^
/Users/danielgarcia/.../Carthage/Checkouts/UnrarKit/Classes/URKArchive.mm:55:1: error: 'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained' [-Werror,-Wobjc-property-assign-on-object-type]
@property (assign) NSString *lastFilepath;
^
2 errors generated.

The project can't be archived due to `-Wobjc-property-assign-on-object-type` flagging a potential memory management error defining `lastArchivePath` and `lastFilepath`. 

Both properties are defined as `assign` but they contain object references. A `copy` would probably work better in this case.

```
/Users/danielgarcia/.../Carthage/Checkouts/UnrarKit/Classes/URKArchive.mm:54:1: error: 'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained' [-Werror,-Wobjc-property-assign-on-object-type]
@Property (assign) NSString *lastArchivePath;
^
/Users/danielgarcia/.../Carthage/Checkouts/UnrarKit/Classes/URKArchive.mm:55:1: error: 'assign' property of object type may become a dangling reference; consider using 'unsafe_unretained' [-Werror,-Wobjc-property-assign-on-object-type]
@Property (assign) NSString *lastFilepath;
^
2 errors generated.
```
@abbeycode abbeycode added this to the 2.10 milestone Nov 26, 2019
@abbeycode abbeycode added the bug label Nov 26, 2019
@abbeycode
Copy link
Owner

Thanks for this! Looks good.

@abbeycode abbeycode merged commit 82cff07 into abbeycode:v2.10 Nov 26, 2019
@abbeycode abbeycode removed this from the 2.10 milestone Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants