Permalink
Browse files

Fix disposing of ShaderProgramCache

Fixes issues #1071, #1181
Also fixes project templates for Windows and Linux to always dispose of the Game object.
  • Loading branch information...
1 parent cee468f commit 9674564bafb4b5c1007af64addee262faa372a66 @KonajuGames KonajuGames committed Jan 15, 2013
@@ -143,7 +143,8 @@ protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
- Clear();
+ if (disposing)
+ Clear();
disposed = true;
}
}
@@ -6,21 +6,21 @@
namespace $safeprojectname$
{
+#ifdef WINDOWS || LINUX
/// <summary>
/// The main class.
/// </summary>
public static class Program
{
- private static Game1 game;
-
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
- game = new Game1();
- game.Run();
+ using (var game = new Game1())
+ game.Run();
}
}
+#endif
}
@@ -6,21 +6,21 @@
namespace $safeprojectname$
{
+#ifdef WINDOWS || LINUX
/// <summary>
/// The main class.
/// </summary>
public static class Program
{
- private static Game1 game;
-
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
- game = new Game1();
- game.Run();
+ using (var game = new Game1())
+ game.Run();
}
}
+#endif
}

0 comments on commit 9674564

Please sign in to comment.