fix the problem of invesalius not shutdown when closed