예제 #1
0
 internal SimpleInfoScreenWrapper()
 {
     allGeysers      = null;
     conditionParent = null;
     labelCache      = new Dictionary <string, CachedStorageLabel>(64);
     lastReport      = null;
     lastSelection   = default;
     lastStressEntry = null;
     processHeaders  = new List <ProcessConditionRow>(8);
     processRows     = new List <ProcessConditionRow>(24);
     processVisible  = new List <ProcessConditionRow>(32);
     rocketLabels    = new HashSet <CachedStorageLabel>();
     setInactive     = new HashSet <CachedStorageLabel>();
     statusActive    = false;
     storages        = new List <Storage>(8);
     storageActive   = false;
     storageLabels   = new HashSet <CachedStorageLabel>();
     storageParent   = null;
     stressActive    = false;
     vitalsActive    = false;
     wasPaused       = false;
     instance        = this;
 }
예제 #2
0
        public override void OnCleanUp()
        {
            int n = processHeaders.Count;

            allGeysers = null;
            foreach (var pair in labelCache)
            {
                pair.Value.Dispose();
            }
            labelCache.Clear();
            // Avoid leaking the report
            lastReport      = null;
            lastStressEntry = null;
            lastSelection   = default;
            // Destroy all process rows
            for (int i = 0; i < n; i++)
            {
                processHeaders[i].Dispose();
            }
            n = processRows.Count;
            for (int i = 0; i < n; i++)
            {
                processRows[i].Dispose();
            }
            processHeaders.Clear();
            processRows.Clear();
            processVisible.Clear();
            storages.Clear();
            // All of these were in the label cache so they should already be disposed
            rocketLabels.Clear();
            storageLabels.Clear();
            storageParent   = null;
            conditionParent = null;
            instance        = null;
            base.OnCleanUp();
        }