Is there any other to "close" the scanner than just setting :
scanner=nothing
devicemanager1=nothing

?