public void Detach()
{
// Engine is dead. Let's forget about it.
m_engine = null;
// Remove any half-done messages from the pipes.
CleanPipes();
// Send the event to the derived class.
Detached();
// Just in case there's only a delimiter in the pipe.
if (m_pipe != null)
m_pipe.CheckRead();
}