Re: NSURLConnection Doesn't Remove itself from run loop when done?
Re: NSURLConnection Doesn't Remove itself from run loop when done?
- Subject: Re: NSURLConnection Doesn't Remove itself from run loop when done?
- From: Jerry Krinock <email@hidden>
- Date: Tue, 6 Oct 2009 05:16:20 -0700
On 2009 Oct 06, at 02:52, Quinn wrote:
I'm not entirely sure what's going on here, but in general I
wouldn't rely on this "no sources so the runloop quits" behaviour.
There are too many ways that oddball sources can get added to the
runloop.
If you really want to debug this, you can use CFShow of
CFRunLoopGetCurrent to see what's actually attached to the runloop.
Yes, you're correct. Looks like there are still lots of sources. See
below [1].
Finally, is adding a little isDone condition in that while() loop
the correct way to fix this?
Yes. That's the approach I'd recommend.
And, of course, it works.
Thank you, Quinn.
[1] Probably won't be very readable in 80-column email, but, for the
record and the curious,
<CFRunLoop 0x10f1d0 [0xa043d1a0]>{locked = false, wait port = 0x1603,
stopped = false,
current mode = (none),
common modes = <CFSet 0x10f2c0 [0xa043d1a0]>{type = mutable, count =
1, capacity = 3, pairs = (
2 : <CFString 0xa0446b40 [0xa043d1a0]>{contents =
"kCFRunLoopDefaultMode"}
)},
common mode items = <CFSet 0x113350 [0xa043d1a0]>{type = mutable,
count = 2, capacity = 24, pairs = (
21 : <CFRunLoopSource 0x10a0e0 [0xa043d1a0]>{locked = No, signalled =
No, valid = Yes, order = -1000, context = <CFMachPort 0x10a0a0
[0xa043d1a0]>{locked = No, valid = Yes, port = 0x1303, source =
0x10a0e0, callout = ??? (0x93038680), context = <CFMachPort context
0x0>}}
31 : <CFRunLoopSource 0x11bfc0 [0xa043d1a0]>{locked = No, signalled =
No, valid = Yes, order = 10, context = <CFMachPort 0x11bcc0
[0xa043d1a0]>{locked = No, valid = Yes, port = 0x3503, source =
0x11bfc0, callout = ??? (0x90cf27cc), context = <CFMachPort context
0x11be30>}}
)},
modes = <CFSet 0x10f300 [0xa043d1a0]>{type = mutable, count = 1,
capacity = 12, pairs = (
14 : <CFRunLoopMode 0x10f380 [0xa043d1a0]>{name =
kCFRunLoopDefaultMode, locked = false, port set = 0x1b03,
sources = <CFSet 0x113390 [0xa043d1a0]>{type = mutable, count = 2,
capacity = 12, pairs = (
5 : <CFRunLoopSource 0x10a0e0 [0xa043d1a0]>{locked = No, signalled =
No, valid = Yes, order = -1000, context = <CFMachPort 0x10a0a0
[0xa043d1a0]>{locked = No, valid = Yes, port = 0x1303, source =
0x10a0e0, callout = ??? (0x93038680), context = <CFMachPort context
0x0>}}
15 : <CFRunLoopSource 0x11bfc0 [0xa043d1a0]>{locked = No, signalled =
No, valid = Yes, order = 10, context = <CFMachPort 0x11bcc0
[0xa043d1a0]>{locked = No, valid = Yes, port = 0x3503, source =
0x11bfc0, callout = ??? (0x90cf27cc), context = <CFMachPort context
0x11be30>}}
)},
observers == (null),
timers = (null)
},
)}}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden