Created
January 4, 2015 05:37
-
-
Save scionwest/3c3858a26451388dae2b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 World | |
| { | |
| public World(IGame game, IWorldService service) | |
| { | |
| game.RegisterShutdown(async () => service.SaveWorld(this)); | |
| } | |
| } | |
| public static class Program | |
| { | |
| public static void Main() | |
| { | |
| IGame game = GameFactory.CreateGame(); | |
| World newWorld = new World(game, null); | |
| game.Worlds.Add(); | |
| // Memory leak. | |
| newWorld = null; | |
| game.Start(); | |
| while(game.IsRunning) | |
| { | |
| // Do stuff. | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment