protected virtual void Dispose(bool disposing) { Refs.Dispose(hFocusedApplicationEvent); Refs.Dispose(hWindowTitleChangeEvent); // TODO: we must find a way to keep those delegate references alive. Ts there really no way in .NET to really keep these delegates from being collected? // Putting GC.KeepAlive will at least prevent the compiler from optimizing out the field references, but it is still possible that the delegate is collected earlier // during a gc run GC.KeepAlive(_HandleSystemForegroundEvent); GC.KeepAlive(_HandleObjectNamechangeEvent); }
protected virtual void Dispose(bool disposing) { Refs.Dispose(CsvWriter); }
private void DisposeNonDesigner(bool disposing) { Refs.Dispose(systemFocusTitleListener); }
private void ActivityMonitorMainForm_FormClosed(object sender, FormClosedEventArgs e) { Refs.Dispose(rowWriter); }