/** * Override the abstract {@link Client}'s unregisterMaze method so we know when to stop the * control thread. */ public synchronized void unregisterMaze() { // Signal the control thread to stop active = false; // Wait half a second for the thread to complete. try { thread.join(500); } catch (Exception e) { // Shouldn't happen } super.unregisterMaze(); }