[DEV] work corectly with refcounting object (and remove some memory leek at close)