Exemplo n.º 1
0
        /// <summary>
        /// Invoked when disposing or finalizing this instance.
        /// </summary>
        /// <param name="disposing">True if the object is being disposed, false otherwise.</param>
        /// <param name="disposeSchema">True to also dispose the schema this instance is
        /// associated with.</param>
        protected virtual void OnDispose(bool disposing, bool disposeSchema)
        {
            if (disposing)
            {
                try
                {
                    if (disposeSchema && _Schema != null && !_Schema.IsDisposed)
                    {
                        _Schema.Dispose();
                    }
                    if (_Values != null)
                    {
                        Array.Clear(_Values, 0, _Values.Length);
                    }
                }
                catch { }
            }

            _Values = null;
            _Schema = null;

            _IsDisposed = true;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Invoked when disposing or finalizing this instance.
        /// </summary>
        /// <param name="disposing">True if the object is being disposed, false otherwise.</param>
        protected virtual void OnDispose(bool disposing)
        {
            if (disposing)
            {
                try
                {
                    if (_Schema != null && !_Schema.IsDisposed)
                    {
                        _Schema.Dispose();
                    }
                    if (_Values != null)
                    {
                        _Values.Clear();
                    }
                }
                catch { }

                _Values = null;
                _Schema = null;
            }

            _IsDisposed = true;
        }