wmi is accessed in kix via com, indeed.
what comes to cleaning of com, only tricky objects require that.
like word or excel or outlook (see the scheme, all Ms off apps)

normal com-objects free up when they are not referenced anymore, that is when your script or udf looses the handle.
that's by exiting or by doing a simple trashing:

;creating:
$obj=createobject(something)
;trashing:
$obj=0
_________________________
!

download KiXnet