Still I am facing the instance available when trying to unload the kext.
expoinfy opened this issue · 1 comments
Hi Slava,
I loaded the module in yosemite osx. And when trying to unload the kext it is saying Can't unload kext com.SlavaImameev.FsdFilter; classes have instances: Below are the command outputs.
Yosmite:user$ sudo kextunload FsdFilter.kext
(kernel) Can't unload kext com.SlavaImameev.FsdFilter; classes have instances:
(kernel) Kext com.SlavaImameev.FsdFilter class FltVnodeHookEntry has 5 instances.
(kernel) Kext com.SlavaImameev.FsdFilter class com_FsdFilter has 1 instance.
(kernel) Kext com.SlavaImameev.FsdFilter class FltIOKitKAuthVnodeGate has 1 instance.
Failed to unload com.SlavaImameev.FsdFilter - (libkern/kext) kext is in use or retained (cannot unload).
Thanks Bhagaban
It was made non-unloadable. If you need to unload you must correctly implement all cleanup, unhooking and synchronization and remove a reference to the class object taken in com_FsdFilter::start
this->retain();