public void Dispose() { if (_endpoint != null) { _endpoint.Dispose(); _endpoint = null; } if (_firefox_process != null) { if (!_firefox_process.HasExited) { _firefox_process.Kill(); _firefox_process.WaitForExit(); } _firefox_process.Dispose(); _firefox_process = null; } if (_profile_dir != null && !this.Persistant && Directory.Exists(_profile_dir)) { IOExt.DeleteDirectoryByShell(_profile_dir); _profile_dir = null; } }
/// <summary> /// Releases all resources. /// </summary> public void Dispose() { _endpoint.Dispose(); if (_process != null) { if (!_process.HasExited) { _process.Kill(); } _process.Dispose(); _process = null; } }