Skip to content

Commit 26a88d9

Browse files
authored
Make examples dispose windows (#1355)
* Load Assimp from source, rather than nuget in GL tut 4.1 * Make all OpenGL examples dispose their IWindow objects properly * Make all Direct3D11 examples dispose their IWindow objects properly
1 parent 5c79408 commit 26a88d9

File tree

18 files changed

+36
-1
lines changed

18 files changed

+36
-1
lines changed

examples/CSharp/Direct3D11 Tutorials/Tutorial 1.2 - Hello quad/Program.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ float4 ps_main(vs_out input) : SV_TARGET {
107107
d3d11.Dispose();
108108
dxgi.Dispose();
109109

110+
//dispose the window, and its internal resources
111+
window.Dispose();
112+
110113
unsafe void OnLoad()
111114
{
112115
// Set-up input context.

examples/CSharp/OpenGL Demos/AndroidDemo/MainActivity.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ protected override void OnRun()
6565
view.Closing += OnClose;
6666

6767
view.Run();
68+
69+
view.Dispose();
6870
}
6971

7072
private static unsafe void OnLoad()

examples/CSharp/OpenGL Demos/AndroidInputDemo/MainActivity.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ protected override void OnRun()
5454
view.Render += OnRender;
5555
view.Closing += OnClose;
5656
view.Run();
57+
58+
view.Dispose();
5759
}
5860

5961
private unsafe static void OnLoad()

examples/CSharp/OpenGL Demos/ImGui/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ static void Main(string[] args)
7474

7575
// Now that everything's defined, let's run this bad boy!
7676
window.Run();
77+
78+
window.Dispose();
7779
}
7880
}
7981
}

examples/CSharp/OpenGL Tutorials/Tutorial 1.1 - Hello Window/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ private static void Main(string[] args)
2424

2525
//Run the window.
2626
window.Run();
27+
28+
window.Dispose();
2729
}
2830

2931

examples/CSharp/OpenGL Tutorials/Tutorial 1.2 - Hello quad/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ private static void Main(string[] args)
6969
window.Closing += OnClose;
7070

7171
window.Run();
72+
73+
window.Dispose();
7274
}
7375

7476

examples/CSharp/OpenGL Tutorials/Tutorial 1.3 - Abstractions/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ private static void Main(string[] args)
4545
window.Closing += OnClose;
4646

4747
window.Run();
48+
49+
window.Dispose();
4850
}
4951

5052

examples/CSharp/OpenGL Tutorials/Tutorial 1.4 - Textures/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ private static void Main(string[] args)
4646
window.Closing += OnClose;
4747

4848
window.Run();
49+
50+
window.Dispose();
4951
}
5052

5153

examples/CSharp/OpenGL Tutorials/Tutorial 1.5 - Transformations/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ private static void Main(string[] args)
4747
window.Closing += OnClose;
4848

4949
window.Run();
50+
51+
window.Dispose();
5052
}
5153

5254

examples/CSharp/OpenGL Tutorials/Tutorial 2.1 - Co-ordinate Systems/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ private static void Main(string[] args)
9191
window.Closing += OnClose;
9292

9393
window.Run();
94+
95+
window.Dispose();
9496
}
9597

9698
private static void OnLoad()

0 commit comments

Comments
 (0)