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

Crash when the Simperium object deallocates #22

Closed
emilylaguna opened this issue Aug 3, 2012 · 6 comments
Closed

Crash when the Simperium object deallocates #22

emilylaguna opened this issue Aug 3, 2012 · 6 comments

Comments

@emilylaguna
Copy link

When attempting to dealloc Simperium the debugger crashes with the following message:

-[SPAuthenticationManager setFailedBlock:]: message sent to deallocated instance

The stack trace is:
`
#0 0x01afddee in _forwarding_ ()
#1 0x01afdcb2 in _CF_forwarding_prep_0 ()
#2 0x000d7239 in -[SPAuthenticationManager dealloc] at /Users/kineticpoet/dev/scratch/simperium-ios-json/simperium-ios-private/Simperium/SPAuthenticationManager.m:62
#3 0x01999e3d in _objc_rootRelease ()
#4 0x01999e00 in objc_release ()
#5 0x01983b39 in objc_setProperty_non_gc ()
#6 0x01983b70 in objc_setProperty ()
#7 0x0004200b in -[Simperium setAuthManager:] at /Users/kineticpoet/dev/scratch/simperium-ios-json/simperium-ios-private/Simperium/Simperium.m:44
#8 0x0003d848 in -[Simperium dealloc] at /Users/kineticpoet/dev/scratch/simperium-ios-json/simperium-ios-private/Simperium/Simperium.m:163
#9 0x01999e3d in _objc_rootRelease ()
#10 0x01999e00 in objc_release ()
#11 0x0199b047 in objc_storeStrong ()

...
`

@mikejohnstn
Copy link
Contributor

b930a6e fixes a deallocation problem, but the one you've encountered appears to be timing dependent. At what stage in your app's lifecycle are you trying to dealloc the Simperium instance?

@emilylaguna
Copy link
Author

I'm dealloc'ing in the middle of the application lifecycle.

I'm trying to offer my users a way to "logout" of Simperium without losing all of their local content.

@mikejohnstn
Copy link
Contributor

The preferred way to do this would be to set networkEnabled to NO. But if you don't need the instance any more, it should be safe to dealloc it. Could you let me know if you consistently see this crash even with the latest commit?

@emilylaguna
Copy link
Author

Hey Mike, I'm still seeing the crash when I'm trying to dealloc Simperium.

I was using trying to use networkEnabled but I would also like a way to disable Simperium when it's not needed in my app.

@mikejohnstn
Copy link
Contributor

It's been awhile. Since you've since launched an app into production, is it safe to say we can close this?

@emilylaguna
Copy link
Author

I've since found a way around deallocating Simperium but the issue still exists.

I've issued a pull request that fixes 2 crashes that I was experiencing.

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

No branches or pull requests

2 participants