From ced435c072e019058f50b7ffbdc1e24afd23c566 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Wed, 2 Sep 2009 22:55:51 +0000 Subject: [PATCH] Create the WinGLControl unconditionally in the constructor. Construction/destruction is done lazily when the actual GLControl handle is created/destroyed. --- Source/GLControl/WinGLControl.cs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/Source/GLControl/WinGLControl.cs b/Source/GLControl/WinGLControl.cs index b1f731e2..cdb1e764 100644 --- a/Source/GLControl/WinGLControl.cs +++ b/Source/GLControl/WinGLControl.cs @@ -113,21 +113,7 @@ namespace OpenTK { this.mode = mode; - control.HandleCreated += delegate(object sender, EventArgs e) - { - if (window_info != null) - window_info.Dispose(); - window_info = Utilities.CreateWindowInfo(mode, ((Control)sender).Handle, true); - }; - - control.HandleDestroyed += delegate(object sender, EventArgs e) - { - if (window_info != null) - { - window_info.Dispose(); - window_info = null; - } - }; + window_info = Utilities.CreateWindowInfo(mode, control.Handle, true); } #endregion