Beispiel #1
0
        void ReportLeak(DefaultResourceLeak resourceLeak)
        {
            //if (!Logger.ErrorEnabled)
            {
                resourceLeak.Dispose();
                return;
            }

            //string records = resourceLeak.Dump();
            //if (this.reportedLeaks.TryAdd(records, true))
            //{
            //    if (records.Length == 0)
            //    {
            //        this.ReportUntracedLeak(this.resourceType);
            //    }
            //    else
            //    {
            //        this.ReportTracedLeak(this.resourceType, records);
            //    }
            //}
        }
        void ReportLeak(DefaultResourceLeak resourceLeak)
        {
            if (!Logger.ErrorEnabled)
            {
                resourceLeak.Dispose();
                return;
            }

            string records = resourceLeak.Dump();

            if (this.reportedLeaks.TryAdd(records, true))
            {
                if (0u >= (uint)records.Length)
                {
                    this.ReportUntracedLeak(this.resourceType);
                }
                else
                {
                    this.ReportTracedLeak(this.resourceType, records);
                }
            }
        }