Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-03-29 17:31:00 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-03-29 17:31:00 +0300
commit9c2e7e4f3759f1474a5906f55b56810cf9d55ebf (patch)
tree3008ff731f1e11f4d15c66a5e8269cf45b0640e2 /Program.cs
parent84908ab28df17928c23e13f4b979780898eac10d (diff)
Possible memory leak fix
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs19
1 files changed, 15 insertions, 4 deletions
diff --git a/Program.cs b/Program.cs
index ee976d62..bd08ee7d 100644
--- a/Program.cs
+++ b/Program.cs
@@ -29,10 +29,21 @@ namespace com.clusterrr.hakchi_gui
static void Main()
{
#if DEBUG
- AllocConsole();
- Stream logFile = File.Create("debuglog.txt");
- Debug.Listeners.Add(new TextWriterTraceListener(logFile));
- Debug.Listeners.Add(new TextWriterTraceListener(System.Console.Out));
+ try
+ {
+ AllocConsole();
+ Debug.Listeners.Add(new TextWriterTraceListener(System.Console.Out));
+ }
+ catch { }
+ try
+ {
+ Stream logFile = File.Create("debuglog.txt");
+ Debug.Listeners.Add(new TextWriterTraceListener(logFile));
+ }
+ catch (Exception ex)
+ {
+ Debug.WriteLine("Error: " + ex.Message + ex.StackTrace);
+ }
Debug.AutoFlush = true;
#endif
bool createdNew = true;