• 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
CURLHandle and retaining
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CURLHandle and retaining


  • Subject: CURLHandle and retaining
  • From: Olivier Destrebecq <email@hidden>
  • Date: Sun, 13 Nov 2005 14:45:37 -0500

I'm using CURLhandle to upload and download some files. When trying to download a file (during the unit testing phase of the build process), i create a CURLhandle and ask it to download a file from an ftp server.

If i don't retain the handle, i get a crash later on in the autorelease pool, because the handle is released one too many times. Note that if I retain it and release it later it crashes too. The only way i found to get it to work is to retain it and not release it.
It works, but does not sound very cocoa like, so i just wanted to check if I was doing anything wrong, or if it is just the way it is supposed to be.


NSURL *url = [NSURL URLWithString: [podcastName stringByAppendingPathExtension: @"rss"]
relativeToURL: [self serverURL]];
[self setDownRssURLHandle: [[url URLHandleUsingCache: NO] retain]];
[[self downRssURLHandle] addClient: self];


    [[self downRssURLHandle] beginLoadInBackground];

once it is done:

    [[self downRssURLHandle] removeClient: self];
    dDownRssURLHandle = nil;


Olivier Destrebecq http://otusweb.spymac.com/portfolio/


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: CURLHandle multiple file upload
  • Next by Date: options for connecting to socket
  • Previous by thread: Re: CURLHandle multiple file upload
  • Next by thread: options for connecting to socket
  • Index(es):
    • Date
    • Thread