diff --git a/Source/OpenTK/Graphics/GraphicsContext.cs b/Source/OpenTK/Graphics/GraphicsContext.cs index 1d6eb6bd..12a605f1 100644 --- a/Source/OpenTK/Graphics/GraphicsContext.cs +++ b/Source/OpenTK/Graphics/GraphicsContext.cs @@ -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); diff --git a/Source/OpenTK/NativeWindow.cs b/Source/OpenTK/NativeWindow.cs index 9b731f53..6e892db9 100644 --- a/Source/OpenTK/NativeWindow.cs +++ b/Source/OpenTK/NativeWindow.cs @@ -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) {