Better memory handling upon closing connect to server dialog