disconnect socket on tab/window close