Skip to content

Instantly share code, notes, and snippets.

@reflash
Last active August 27, 2018 14:20
Show Gist options
  • Save reflash/772a99b678029c2b2921e6673a72b6ec to your computer and use it in GitHub Desktop.
Save reflash/772a99b678029c2b2921e6673a72b6ec to your computer and use it in GitHub Desktop.
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