Re: NSURLConnection not removing itself from the RunLoop ?
Re: NSURLConnection not removing itself from the RunLoop ?
- Subject: Re: NSURLConnection not removing itself from the RunLoop ?
- From: Fritz Anderson <email@hidden>
- Date: Thu, 10 Jul 2003 09:58:09 -0500
There is no guarantee that you are the only supplier of sources to a
run loop. Once you run it, other sources may attach without any notice
to you. -[NSRunLoop run] is therefore not guaranteed to return promptly
after events of interest to you.
If you want a run loop to stop promptly, run the it repeatedly with
runMode:beforeDate: or runUntilDate:, and stop repeating when you lose
interest.
-- F
On Wednesday, July 9, 2003, at 10:41 AM, Thomas Deniau wrote:
In a separate thread, I create a NSURLConnection and then run the run
loop :
NSLog(@"Running run loop");
[[NSRunLoop currentRunLoop] run];
NSLog(@"Run loop exiting");
The problem is that the run loop never exits even when my connection
has sent me the connectionDidFinishLoading: message.
So i tried to do a [connection cancel] anyway, but the run loop
doesn't exit either.
Indeed, when I try to log the run loop (after having cancelled the
connection, or even after having RELEASED it), I get
<CFRunLoop 0x4a616d0 [0xa01303fc]>
[......]
sources = <CFSet 0x4a63e20 [0xa01303fc]>{count = 1, capacity = 11,
values = (
0 : <CFRunLoopSource 0x4a63d30 [0xa01303fc]>{locked = No, valid =
Yes, order = 0, context = <CFRunLoopSource context 0x4a61690>}
[......]
When I log the run loop in connection:didReceiveData: (that is, when
the connection isn't finished yet) I get the same sources.
So that means that the connection doesn't remove itself from the run
loop's sources... even when it's cancelled or released.
How can I force the connection to clean up the run loop's sources ?
--
Fritz Anderson - Consulting Programmer - Chicago, IL
Mail: <email@hidden>
Risumi: <
http://resume.manoverboard.org>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.