/// <summary> /// Clears the inner fields before new computation is performed. /// </summary> private void clearComputation() { AnalysisWarningHandler.ResetWarnings(); IsFirstPhaseStarted = false; IsSecondPhaseStarted = false; IsFirstPhaseFinished = false; IsSecondPhaseFinished = false; analysisWarnings = null; securityWarnings = null; secondPhaseWarnings = null; programPointGraph = null; firstPhaseAnalysis = null; secondPhaseAnalysis = null; // Force garbage collecting GC.Collect(); GC.WaitForPendingFinalizers(); }
/// <summary> /// Runs the second phase analysis. /// </summary> private void runSecondPhaseAnalysis() { secondPhaseAnalysis = createNextPhaseAnalysis(); if (secondPhaseAnalysis != null) { secondPhaseWarnings = getSecondPhaseWarnings(); State = AnalysisState.NextPhaseAnalysis; IsSecondPhaseStarted = true; try { WatchSecondPhase.Start(); secondPhaseAnalysis.Analyse(); } finally { WatchSecondPhase.Stop(); SecondPhaseEndMemory = GC.GetTotalMemory(true); } IsSecondPhaseFinished = true; } }