From 1b0f26cea1e5c1148ac8bc10c576ed0ff8e1a39f Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Thu, 8 Nov 2018 11:45:22 -0600 Subject: [PATCH] Changes for #170 --- GBM/Forms/frmMain.vb | 2 ++ GBM/Managers/mgrProcessDetection.vb | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index 927572e..12c80d2 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -1971,6 +1971,8 @@ Public Class frmMain StopScan() End If End If + + GC.Collect() End Sub Private Sub bwMonitor_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles bwMonitor.DoWork diff --git a/GBM/Managers/mgrProcessDetection.vb b/GBM/Managers/mgrProcessDetection.vb index 52619b2..9fda12d 100644 --- a/GBM/Managers/mgrProcessDetection.vb +++ b/GBM/Managers/mgrProcessDetection.vb @@ -12,6 +12,7 @@ Public Class mgrProcessDetection Private oDuplicateGames As New ArrayList Private bDuplicates As Boolean Private bVerified As Boolean = False + Private oRegEx As Regex Property FoundProcess As Process Get @@ -143,7 +144,8 @@ Public Class mgrProcessDetection Private Function IsMatch(ByRef oGame As clsGame, ByRef sProcessCheck As String) As Boolean If oGame.IsRegEx Then Try - If Regex.IsMatch(sProcessCheck, oGame.ProcessName) Then + oRegEx = New Regex(oGame.ProcessName) + If oRegEx.IsMatch(sProcessCheck) Then Return True End If Catch