• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: knowing when WebView is done
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: knowing when WebView is done


  • Subject: Re: knowing when WebView is done
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Fri, 06 Jun 2008 22:32:11 -0700


On Jun 6, 2008, at 10:06 PM, Timothy Ritchey wrote:

Out of curiosity, did you ever check the retain counts on your webview objects?

Never. Since the frameworks retain/(auto)release stuff all the time behind your back, logging -retainCount is worse than useless, in my opinion.


If something's leaking, I use Instruments or OmniObjectMeter to see what's holding on to it. In this case, I keep a small pool of WebViews around and reuse them, so I've never bothered to check.

- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
{
if(frame == [sender mainFrame]) {


       ... grab thumbnail image ...

       [webView stopLoading:nil];
       [webView setFrameLoadDelegate:nil];
       NSLog(@"retain count (before): %d", CFGetRetainCount(webView));
       [webView release];
       NSLog(@"retain count (after): %d", CFGetRetainCount(webView));
   }
}

and the log file shows a retain count of 2 before, and 1 after. Something else is holding onto my webView, or it has been so long since I've programmed cocoa in anger that I've lost all sense of alloc/init behavior.

From a quick check with Instruments, it looks like internal WebKit stuff is retaining the view for callbacks even after it's done loading, then releasing it on a later pass through the runloop. I wouldn't worry about it unless you're actually leaking the object.


--
Adam
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: knowing when WebView is done
      • From: Timothy Ritchey <email@hidden>
References: 
 >Re: knowing when WebView is done (From: Mark Bateman <email@hidden>)
 >Re: knowing when WebView is done (From: Rush Manbert <email@hidden>)
 >Re: knowing when WebView is done (From: Timothy Ritchey <email@hidden>)
 >Re: knowing when WebView is done (From: "Adam R. Maxwell" <email@hidden>)
 >Re: knowing when WebView is done (From: Timothy Ritchey <email@hidden>)

  • Prev by Date: Re: knowing when WebView is done
  • Next by Date: Re: Garbage collector vs variable lifetime
  • Previous by thread: Re: knowing when WebView is done
  • Next by thread: Re: knowing when WebView is done
  • Index(es):
    • Date
    • Thread