File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,10 @@ internal class GlfwPlatform : IWindowPlatform
2323 (
2424 ( ) =>
2525 {
26+ GLFW . Glfw ? api = null ;
2627 try
2728 {
28- GLFW . Glfw . GetApi ( ) ; // activate the class so we can determine if we can activate the class
29+ api = GLFW . Glfw . GetApi ( ) ; // activate the class so we can determine if we can activate the class
2930 }
3031 catch ( Exception ex )
3132 {
@@ -34,6 +35,10 @@ internal class GlfwPlatform : IWindowPlatform
3435#endif
3536 return false ;
3637 }
38+ finally
39+ {
40+ api ? . Dispose ( ) ;
41+ }
3742
3843 return true ;
3944 }
Original file line number Diff line number Diff line change @@ -34,9 +34,10 @@ public static SdlPlatform GetOrRegister()
3434 (
3535 ( ) =>
3636 {
37+ SDL . Sdl ? api = null ;
3738 try
3839 {
39- SDL . Sdl . GetApi ( ) ;
40+ api = SDL . Sdl . GetApi ( ) ;
4041 }
4142 catch ( Exception ex )
4243 {
@@ -45,6 +46,10 @@ public static SdlPlatform GetOrRegister()
4546#endif
4647 return false ;
4748 }
49+ finally
50+ {
51+ api ? . Dispose ( ) ;
52+ }
4853
4954 return true ;
5055 }
You can’t perform that action at this time.
0 commit comments