Skip to content

Instantly share code, notes, and snippets.

@scionwest
Created January 4, 2015 05:37
Show Gist options
  • Save scionwest/3c3858a26451388dae2b to your computer and use it in GitHub Desktop.
Save scionwest/3c3858a26451388dae2b to your computer and use it in GitHub Desktop.
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