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();
            }

            if (_vw != null)
            {
                int hr = _vw.put_Owner(IntPtr.Zero);
                _vw = null;
            }

            if (_evr != null)
            {
                // not needed as EVR does not accept a non-valid (even null) handle

                /*
                 * try
                 * {
                 *  _evr.SetVideoWindow(IntPtr.Zero);
                 * }
                 * catch (Exception ex)
                 * {
                 #if DEBUG
                 *  MessageBox.Show(ex.Message, "Failed to reset EVR Window");
                 #endif
                 * }
                 * finally
                 * {
                 *  _evr = null;
                 * }
                 */
            }

            if (_detachedWindow != null)
            {
                _detachedWindow.Close();
            }

            base.Dispose(disposing);
        }
Exemplo n.º 2
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();
            }

            if (_vw != null)
            {
                int hr = _vw.put_Owner(IntPtr.Zero);
                _vw = null;
            }

            if (_evr != null)
            {
                try
                {
                    _evr.SetVideoWindow(IntPtr.Zero);
                }
                catch (Exception ex)
                {
#if DEBUG
                    MessageBox.Show(ex.Message, "Failed to reset EVR Window");
#endif
                }
                finally
                {
                    _evr = null;
                }
            }

            if (_detachedWindow != null)
            {
                _detachedWindow.Close();
            }

            base.Dispose(disposing);
        }