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
Avoid a lockup when adding an entry to the catalog. Fixes #1388 #1410
Conversation
Fixes #1388 |
I've added another commit which (hopefully) fixes one of the two remaining crash reports we're getting (yay!) Reasoning behind why these might fix the code is from Mike Ash:
OK, we're not using imageNamed here, but the object icon is really a 'shared icon' (used all over the places in different forms) so we should make a copy of it before playing with it. We should probably Also, retaining the
So this is perhaps an easy and less performance-affecting way of solving threading problems
|
Seems like a good way to chew up memory. :-) I'd say only I read that article and thought the
Agreed. I wondered if we should be doing that in other places, like retaining a Anyway, changes here look good. |
Maybe the NSImage system is clever enough to handle copy-on-write ;-). This should be checked, I'd prefer all code to go through a |
Agreed. Copying is preferable to having to remember. I've just done a quick comparison on the memory usage after loading /usr/bin with this branch and master, and it seems that this does increase memory usage quite a bit (maybe up to 10MB) so should we remove the copy? |
Not really sure what the code is doing, but it looks like |
This reverts commit 9d9c9a9.
Remove code that modifies the NSImage
OK, I've reverted that commit and added another one. I've taken out all the |
Avoid a lockup when adding an entry to the catalog. Fixes #1388
Use
runOnMainQueueSync
instead of blindly trying to run the block on the main threadThe lock would only occur if you have 'run tasks and actions in the background' disabled in the extras prefs.
Delete this branch when it's merged, I might be on a plane somewhere :D