public void UnsetProcess() { if (AttachmentWorker != null) { AttachmentWorker.StopScanning(); AttachmentWorker.Dispose(); } try { if (IsAttached) { UnsafeNativeMethods.CloseHandle(Instance.ProcessHandle); } } catch (Exception) { // IGNORED } finally { Constants.ProcessHandle = ProcessHandle = IntPtr.Zero; IsAttached = false; } }
public void Dispose() { try { if (this.IsAttached) { UnsafeNativeMethods.CloseHandle(this.ProcessHandle); } } catch (Exception ex) { // IGNORED } finally { this.IsAttached = false; this.RaiseMemoryHandlerDisposed(); } }