Sometimes we can call ed_detach() before the mtx has been initialized. Avoid it if it hasn't been initialized.
Sometimes we can call ed_detach() before the mtx has been initialized.
Avoid it if it hasn't been initialized.

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase