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

Compatibility with Sudden Termination #73

Merged
merged 19 commits into from
Nov 27, 2012
Merged

Conversation

mikeabdullah
Copy link
Collaborator

Prefs etc. are updated as they change, rather than waiting till the app quitting. NSUserDefaults is smart enough not to make that expensive.

Addresses issue #71

@yoavhacohen
Copy link

It seems to me that there is a bug in commit eb363dd

The new line should be:

NSDictionary* stateDict = [self _preferences];

Instead of:

NSDictionary* stateDict = [IMBConfig prefsForClass:self.class];

The current code always returns nil and the expanded nodes states is not restored.
After making this correction, the code works fine to me.
Would you be able to commit this fix?

@mikeabdullah
Copy link
Collaborator Author

@yoavhacohen thanks for spotting this; fixed in 25a080b

@yoavhacohen
Copy link

Thanks for the quick fix.
In 10.8, disableAutomaticTermination: should be called before writing the state. Otherwise the application might be terminated while writing the UI state and make it inconsistent.

@mikeabdullah
Copy link
Collaborator Author

Do you have any evidence for this? The frameworks are pretty good at automatically disabling sudden termination on your behalf as appropriate. I admit I haven't looked at automatic termination yet though; would argue it's a different case.

mikeabdullah added a commit that referenced this pull request Nov 27, 2012
Compatibility with Sudden Termination
@mikeabdullah mikeabdullah merged commit 8d0a12d into master Nov 27, 2012
danielpunkass pushed a commit to danielpunkass/iMedia that referenced this pull request Dec 11, 2015
Various fixes to quiet warnings about nullability, clang analyis issues, potential memory leaks.
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.

2 participants