fixed crash when pressing red x button..

exiting the game without disconnecting from the server first would cause
the scenegraph to crash.  This fixes that.