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

Bug: Memory management incorrect. #41

Closed
pkluz opened this issue Jan 2, 2012 · 1 comment
Closed

Bug: Memory management incorrect. #41

pkluz opened this issue Jan 2, 2012 · 1 comment

Comments

@pkluz
Copy link

pkluz commented Jan 2, 2012

Hey Sam, first of all - I just found your library and gotta say I really like it :) It just "feels" better than the others. Simple as :)

Sadly I haven't had time to read through the code yet but what I found is this:

2012-01-02 23:44:56.090 SVProgressHUDTest[2265:707] *** -[UIWindow release]: message sent to deallocated instance 0x1f6260

Here's the backtrace:

(gdb) bt
#0  0x3801c8a0 in ___forwarding___ ()
#1  0x37f77680 in __forwarding_prep_0___ ()
#2  0x00007c40 in __24-[SVProgressHUD dismiss]_block_invoke_0149 (.block_descriptor=, finished=1 '\001') at /Volumes/Development/nehira.com/SVProgressHUD/SVProgressHUD/SVProgressHUD.m:457
#3  0x353ed0be in -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] ()
#4  0x353e781a in -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] ()
#5  0x353ecfb8 in -[UIViewAnimationState animationDidStop:finished:] ()
#6  0x33795ba6 in CA::Layer::run_animation_callbacks ()
#7  0x37cd7f7a in _dispatch_main_queue_callback_4CF$VARIANT$mp ()
#8  0x37fed2dc in __CFRunLoopRun ()
#9  0x37f704dc in CFRunLoopRunSpecific ()
#10 0x37f703a4 in CFRunLoopRunInMode ()
#11 0x37aeefcc in GSEventRunModal ()
#12 0x35400742 in UIApplicationMain ()
#13 0x00002802 in main (argc=1, argv=0x2fdffad0) at /Volumes/Development/nehira.com/SVProgressHUDTest/SVProgressHUDTest/main.m:15

What I can see so far:I wouldn't recommend calling release on a property. This can result in unexpected behavior. On a sidenote, that's where it crashes:
Line 457: [self.overlayWindow release];

How to replicate it:
Well,... I just went mental and tapped the button which triggers my showInView: a bazillion times in a row :) What's the special thing about my case? Somewhere in between my delegate call (which is triggered if an asynchronous request finishes) will attempt to dismiss the HUD again. -> Crash.

As said I haven't had the time to go over the code yet (as I'm using it for what it is :) - out of the box) what I'd do first and foremost though is this:
http://cocoasamurai.blogspot.com/2011/04/singletons-your-doing-them-wrong.html

If I have some time these days I'll do a fork and fix this stuff and send you a pull but at the moment I don't have much of it sorry :|

@samvermette
Copy link
Contributor

Pushed a small fix as an attempt to fix your crash. Let me know if it works, and thank you for the heads up!

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