protected virtual void Dispose(bool CleanUpNativeAndManagedResources)
 {
     if (CleanUpNativeAndManagedResources)
     {
         if (HitResource != null)
         {
             HitResource.Dispose();
         }
         if (Events != null)
         {
             Events.Dispose();
         }
     }
 }
Example #2
0
        /// <summary>
        /// Disposes of the resources used by this HitResourcegroup instance.
        /// <param name="Disposed">Was this resource disposed explicitly?</param>
        /// </summary>
        protected virtual void Dispose(bool Disposed)
        {
            if (Disposed)
            {
                if (HitResource != null)
                {
                    HitResource.Dispose();
                }
                if (Events != null)
                {
                    Events.Dispose();
                }

                // Prevent the finalizer from calling ~HitResourcegroup, since the object is already disposed at this point.
                GC.SuppressFinalize(this);
            }
            else
            {
                m_Logger.Error("HitResourcegroup not explicitly disposed!");
            }
        }