protected Dispose ( bool disposing ) : void | ||
disposing | bool | /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. /// |
Résultat | void |
void CloseCamera() { lock (m_sync) { if (m_videoCapture != null) { m_videoCapture.Dispose(); } m_videoCapture = null; if (m_image != null) { m_image.Dispose(); } } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { released = true; cap.Release(); cap.Dispose(); }