Exemplo n.º 1
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();

                //The context is a Disposable component. We could get away with not disposing
                //it since we have only one form and it would be cleaned up on exit, but it is
                //a good habit to get into, especially because most projects are not this simple
                //and would create memory leaks if not handled properly.
                ctx.Dispose();
            }
            base.Dispose(disposing);
        }
Exemplo n.º 2
0
 protected override void Dispose(bool disposing)
 {
     db.Dispose();
     base.Dispose(disposing);
 }