Skip to content
This repository has been archived by the owner on Jun 2, 2018. It is now read-only.

UIWebView delegate being overreleased #64

Closed
nicked opened this issue Jan 30, 2012 · 3 comments
Closed

UIWebView delegate being overreleased #64

nicked opened this issue Jan 30, 2012 · 3 comments

Comments

@nicked
Copy link

nicked commented Jan 30, 2012

I have a custom view controller (WebViewController) that contains a UIWebView, and which is also the delegate of that web view.

Note that while I am using BlocksKit in this project, this UIWebView does not use any BlocksKit extensions.

When the WebViewController is dismissed, regardless of whether the URL had finished loading or not, I get:

*** -[WebViewController release]: message sent to deallocated instance

from AutoreleasePoolPage::pop.

Also note that my project is using ARC, so at no point am I manually releasing anything.

In the dealloc method of my WebViewController, I am setting the UIWebView's delegate to nil, so that shouldn't be causing any problems.

When I exclude UIWebView+BlocksKit.m from the project, everything works fine.

Sorry I don't know how to debug this any better, let me know if there's anything I can try to get you more info.

Cheers,
Nick

@crayment
Copy link

+1.

I think when you set the UIWebView's delegate to nil, the "realDelegate" internal to blockskit is now pointing to a possibly deallocated object.

@zwaldowski
Copy link
Collaborator

But whenever you set the realDelegate (BlocksKit does this automatically for you when you call the normal delegate setter), we attach a block to the real delegate that nils out our reference when it gets deallocated. However, we retain/autorelease whenever getting the real delegate to prevent it from unexpectedly disappearing. I think that might be the cause. We'll investigate alternate methods. Thanks for reporting this.

@zwaldowski
Copy link
Collaborator

We have a fix in our next branch, pending some investigation. Don't want to make it worse than before. ;-) Should be out shortly.

EDIT: Fixed in 1.0.5. Cheers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants