diff --git a/ExtLibs/Controls/HUD.cs b/ExtLibs/Controls/HUD.cs index dc4dc6369a..79a8aceea4 100644 --- a/ExtLibs/Controls/HUD.cs +++ b/ExtLibs/Controls/HUD.cs @@ -274,6 +274,30 @@ public HUD() graphicsObjectGDIP = new GdiGraphics(Graphics.FromImage(objBitmap)); } + protected override void Dispose(bool disposing) + { + log.Info("HUD Dispose"); + + if (opengl) + { + foreach (character texid in _texture) + { + if (texid != null && texid.gltextureid != 0) + GL.DeleteTexture(texid.gltextureid); + } + + this._texture = new character[_texture.Length]; + + foreach (character texid in charDict.Values) + { + if (texid.gltextureid != 0) + GL.DeleteTexture(texid.gltextureid); + } + } + + base.Dispose(disposing); + } + private float _roll = 0; private float _navroll = 0; private float _pitch = 0; @@ -1782,8 +1806,6 @@ public void FillRectangle(Brush brushh, RectangleF rectf) GL.Begin(PrimitiveType.TriangleFan); - GL.LineWidth(0); - if (((Type) brushh.GetType()) == typeof(LinearGradientBrush)) { LinearGradientBrush temp = (LinearGradientBrush) brushh;