Release all resources on close