void OnDestroy() { // ask Laalys to quit if (networkStream != null) { byte[] sendBytes = Encoding.UTF8.GetBytes("Quit"); networkStream.Write(sendBytes, 0, sendBytes.Length); } // close Socket if (clientSocket != null) { clientSocket.Close(); } if (serverSocket != null) { serverSocket.Stop(); } // Stop process if (LaalysProcess != null && !LaalysProcess.HasExited) { // Stop to capture output stream LaalysProcess.Exited -= LaalysEH; LaalysProcess.Kill(); } // Save traces if (Application.isPlaying && debugLogs) { XmlHandler.saveTraces(SceneManager.GetActiveScene().name); } if (Instance == this) { Instance = null; } }
void OnDestroy() { // close Socket if (clientSocket != null) { clientSocket.Close(); } if (serverSocket != null) { serverSocket.Stop(); } // Stop process if (LaalysProcess != null && !LaalysProcess.HasExited) { // Stop to capture output stream LaalysProcess.Exited -= LaalysEH; LaalysProcess.Kill(); } // Save traces if (Application.isPlaying) { XmlHandler.saveTraces(SceneManager.GetActiveScene().name); } if (Instance == this) { Instance = null; } }