Skip to content

Commit

Permalink
Fixed GUI consuming heaps of CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
bbepis committed Dec 28, 2015
1 parent 33b47b6 commit f3ddf86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions AA2Install/7z.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Diagnostics;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.Threading;

namespace AA2Install.Archives
{
Expand Down Expand Up @@ -37,6 +38,7 @@ public static Mod Index(string filename, bool miscFiles = false)
while (!p.HasExited)
{
Application.DoEvents();
Thread.Sleep(100);
}
p.WaitForExit();
}
Expand Down Expand Up @@ -108,6 +110,7 @@ public static string Extract(string filename, string dest = "")
while (!p.HasExited)
{
Application.DoEvents();
Thread.Sleep(100);
}
}
return dest;
Expand Down Expand Up @@ -138,6 +141,7 @@ public static string ExtractWildcard(string filename, string wildcard, string de
while (!p.HasExited)
{
Application.DoEvents();
Thread.Sleep(100);
}
}
return Paths.TEMP;
Expand Down Expand Up @@ -168,6 +172,7 @@ public static bool Compress(string filename, string workingdir, string directory
while (!p.HasExited)
{
Application.DoEvents();
Thread.Sleep(100);
}
}
return System.IO.File.Exists(filename);
Expand Down
1 change: 1 addition & 0 deletions AA2Install/formMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ public bool inject(bool createBackup = false, bool checkConflicts = true, bool s
while (bb.IsBusy)
{
Application.DoEvents();
Thread.Sleep(100);
}
}
else
Expand Down

0 comments on commit f3ddf86

Please sign in to comment.