IOEventSource subclass won't unload?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com I'm perplexed :( 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Brian Doyle