Fixed crash on closing of point selection dialog
also crash for other windows are prevented