def METHOD_NAME( self ):
    if self.handle:
        try:
            PyOhNet.devices.remove( self )
        except:
            pass
        self.lib.CpDeviceCRemoveRef( self.handle )
        self.handle = None