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

Make ASWeakMapEntry Value Atomic #555

Merged
merged 6 commits into from
Sep 8, 2017
Merged

Make ASWeakMapEntry Value Atomic #555

merged 6 commits into from
Sep 8, 2017

Conversation

Adlai-Holler
Copy link
Member

We are seeing a variety of memory corruption crashes around the image values in the ASImageNode display pipeline.

It could be unrelated, but there exists a race on the value property of ASWeakMapEntry which is implemented nonatomic but is read/written from different threads.

Copy link
Contributor

@maicki maicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -19,6 +19,7 @@

@interface ASWeakMapEntry ()
@property (nonatomic, strong) NSObject *key;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May worth making key read-only.

@Adlai-Holler
Copy link
Member Author

I went a little overboard and also changed the NSObject * declarations to id. Outside the scope of this diff but we almost never touch these files and using NSObject * when it's not needed is tragic.

CHANGELOG.md Outdated
@@ -16,6 +16,7 @@
- Table and collection views to consider content inset when calculating (default) element size range [Huy Nguyen](https://github.com/nguyenhuy) [#525](https://github.com/TextureGroup/Texture/pull/525)
- [ASEditableTextNode] added -editableTextNodeShouldBeginEditing to ASEditableTextNodeDelegate to mirror the corresponding method from UITextViewDelegate. [Yan S.](https://github.com/yans) [#535](https://github.com/TextureGroup/Texture/pull/535)
- [Breaking] Remove APIs that have been deprecated since 2.0 and/or for at least 6 months [Huy Nguyen](https://github.com/nguyenhuy) [#529](https://github.com/TextureGroup/Texture/pull/529)
- Fixed a memory corruption issue in the ASImageNode display system. [Adlai Holler](https://github.com/Adlai-Holler) [#55](https://github.com/TextureGroup/Texture/pull/555)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "#555"

@TextureGroup TextureGroup deleted a comment Sep 7, 2017
@nguyenhuy nguyenhuy merged commit 53e99cc into master Sep 8, 2017
bernieperez pushed a commit to AtomTickets/Texture that referenced this pull request Apr 25, 2018
* Make ASWeakMapEntry value atomic

* Increment changelog

* Go a little nuts

* Update CHANGELOG.md
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.

None yet

3 participants