[OpenTK] Register GraphicsContext and NativeWindow
authorthefiddler <stapostol@gmail.com>
Wed, 23 Jul 2014 12:35:33 +0000 (14:35 +0200)
committerthefiddler <stapostol@gmail.com>
Wed, 23 Jul 2014 12:35:33 +0000 (14:35 +0200)
Source/OpenTK/Graphics/GraphicsContext.cs
Source/OpenTK/NativeWindow.cs

index 1d6eb6b..12a605f 100644 (file)
@@ -150,6 +150,7 @@ namespace OpenTK.Graphics
 
                         implementation = factory.CreateGLContext(mode, window, shareContext, direct_rendering, major, minor, flags);
                         handle_cached = ((IGraphicsContextInternal)implementation).Context;
+                        factory.RegisterResource(this);
                     }
 
                     AddContext(this);
index 9b731f5..6e892db 100644 (file)
@@ -102,7 +102,9 @@ namespace OpenTK
             this.options = options;
             this.device = device;
 
-            implementation = Factory.Default.CreateNativeWindow(x, y, width, height, title, mode, options, this.device);
+            IPlatformFactory factory = Factory.Default;
+            implementation = factory.CreateNativeWindow(x, y, width, height, title, mode, options, this.device);
+            factory.RegisterResource(this);
 
             if ((options & GameWindowFlags.Fullscreen) != 0)
             {