Skip to content

Commit

Permalink
Fix disposing of ShaderProgramCache
Browse files Browse the repository at this point in the history
Fixes issues #1071, #1181
Also fixes project templates for Windows and Linux to always dispose of the Game object.
  • Loading branch information
KonajuGames committed Jan 15, 2013
1 parent cee468f commit 9674564
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion MonoGame.Framework/Graphics/Shader/ShaderProgramCache.cs
Expand Up @@ -143,7 +143,8 @@ protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
Clear();
if (disposing)
Clear();
disposed = true;
}
}
Expand Down
8 changes: 4 additions & 4 deletions ProjectTemplates/VisualStudio2010/Linux/Program.cs
Expand Up @@ -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
}
8 changes: 4 additions & 4 deletions ProjectTemplates/VisualStudio2010/WindowsGL/Program.cs
Expand Up @@ -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.