Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 9674564bafb4b5c1007af64addee262faa372a66 1 parent cee468f
@KonajuGames KonajuGames authored
View
3  MonoGame.Framework/Graphics/Shader/ShaderProgramCache.cs
@@ -143,7 +143,8 @@ protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
- Clear();
+ if (disposing)
+ Clear();
disposed = true;
}
}
View
8 ProjectTemplates/VisualStudio2010/Linux/Program.cs
@@ -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
}
View
8 ProjectTemplates/VisualStudio2010/WindowsGL/Program.cs
@@ -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
}
Please sign in to comment.
Something went wrong with that request. Please try again.