protected void destroy() {
      search_destroyed = true;

      if (twc != null) {

        twc.destroy();

        twc = null;
      }

      if (timer_event != null) {

        timer_event.cancel();

        timer_event = null;
      }

      if (control_socket != null) {

        try {
          control_socket.close();

        } catch (Throwable e) {
        }

        control_socket = null;
      }
    }