@Override
    public void destroy () {
        assert (pipe == null);

        //  If there's still a pending linger timer, remove it.
        if (has_linger_timer) {
            io_object.cancel_timer (linger_timer_id);
            has_linger_timer = false;
        }

        //  Close the engine.
        if (engine != null)
            engine.terminate ();
        
    }