Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void
コード例 #1
0
        private void btnInnerException_Click(object sender, EventArgs e)
        {
            var errorViewer = new ExceptionViewer(_exception.InnerException);
            errorViewer.ShowDialog();

            errorViewer.Dispose();
            GC.Collect(1);
        }
コード例 #2
0
        private void btnInnerException_Click(object sender, EventArgs e)
        {
            var errorViewer = new ExceptionViewer(_exception.InnerException);

            errorViewer.ShowDialog();

            errorViewer.Dispose();
            GC.Collect(1);
        }