Last active
August 27, 2018 14:20
-
-
Save reflash/772a99b678029c2b2921e6673a72b6ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Program { | |
public static event EventHandler listener; | |
static void Main(string[] args) { | |
string input = ""; | |
bool ended = false; | |
while (!ended) { | |
Console.WriteLine("type in command: "); | |
input = Console.ReadLine(); | |
switch (input) { | |
case "start": | |
CreateMemoryLeak(); | |
break; | |
case "quit": | |
ended = true; | |
break; | |
default: | |
break; | |
} | |
} | |
} | |
static void CreateMemoryLeak() { | |
MemoryLeak[] Leak = new MemoryLeak[1000]; | |
for (int i = 0; i & amp; amp; lt; 1000; i++) { | |
Leak[i] = new MemoryLeak(); | |
Leak[i].Start(); | |
} | |
} | |
} | |
public class MemoryLeak { | |
public void Start() { | |
Program.listener += new EventHandler(Some); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment