IGNORE: IOEventSource subclass won't unload?
IGNORE: IOEventSource subclass won't unload?
- Subject: IGNORE: IOEventSource subclass won't unload?
- From: Brian Doyle <email@hidden>
- Date: Fri, 3 Mar 2006 02:23:50 -0800
Hmm, it's late and I'm punchy I guess. I missed that one last little
itty-bitty sentence in the IOEventSource docs that says I need to
manage the retention of the object myself. Sorry. Apparently it
seems adding the object to the workloop and immediately releasing it
is bad form too.
Would anyone care to tell me why I'm don't have to explicitly release
IOCommandGate and IOTimerEventSource objects (i.e. the kext will
unload if I don't), but with my custom object I do have to explicitly
release it?
Thanks!
Brian
On Mar 3, 2006, at 1:51 AM, Brian Doyle wrote:
I'm perplexed :(
I've created a custom event source subclassed from IOEventSource
that as near as I can tell is correct. It is very simple and
follows fairly closely the layout of IOCommandGate. When I call
attachEventSource() it attaches, the IOWorkLoop calls checkForWork
() and dispatches to the Action handler correctly, there's nothing
special about initialization, it calls super::init() and behaves
appropriately. After instantiation I attach it to the workloop
(retain count==2) and then I release it and have verified that the
retain count is 1 (i.e. retained only by the workloop). So it
appears all is well and good, until I try to unload my kext, at
which point it refuses saying that there is still an instance of my
event source.
I've attaching several other event sources to the same workloop
(an IOCommandGate and an IOTimerEventSource) and I release them
after they attach sucessfully (with a verifiable retain count of
1). The code is identical yet these unload just fine (presumably
when the workloop is released).
Commenting out just the add-it-to-the-workloop part allows
everything to unload properly (just allocating and releasing my
event source without ever attaching it to the workloop allows the
kext to unload fine). So it just seems to cause a problem when it
is attached into the workloop.
Anyone have any ideas on why this might be happening?
Thank you,
Brian
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40balance-software.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden