From f2bb114a65610ff4eb9b6be4b194005cf8ae7850 Mon Sep 17 00:00:00 2001
From: "Adam D. Ruppe" <destructionator@gmail.com>
Date: Sat, 5 Aug 2023 12:12:43 -0400
Subject: [PATCH] omg we never freed these contexts

---
 simpledisplay.d | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/simpledisplay.d b/simpledisplay.d
index 82a8fe8..1ba0a56 100644
--- a/simpledisplay.d
+++ b/simpledisplay.d
@@ -11767,6 +11767,10 @@ version(Windows) {
 		}
 
 		void closeWindow() {
+			if(ghRC) {
+				wglDeleteContext(ghRC);
+				ghRC = null;
+			}
 			DestroyWindow(hwnd);
 		}
 
@@ -14951,6 +14955,12 @@ mixin DynamicLoad!(XRandr, "Xrandr", 2, XRandrLibrarySuccessfullyLoaded) XRandrL
 				customEventFDRead = -1;
 				customEventFDWrite = -1;
 			}
+
+			if(glc !is null) {
+				glXDestroyContext(display, glc);
+				glc = null;
+			}
+
 			if(buffer)
 				XFreePixmap(display, buffer);
 			bufferw = bufferh = 0;