diff options
author | sanine <sanine.not@pm.me> | 2022-08-23 13:28:11 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-08-23 13:28:11 -0500 |
commit | 25ed7eb9f84e9a822f698ad803901fbb2a5354cf (patch) | |
tree | 48ea34e893cd60fdc1ef1b694e22cde857cf2e51 /src/gl/window.c | |
parent | ae4e17fc743ca0344af818ab767db7311ea7829c (diff) |
fix memory leak
Diffstat (limited to 'src/gl/window.c')
-rw-r--r-- | src/gl/window.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gl/window.c b/src/gl/window.c index 1b8c4bb..fd13022 100644 --- a/src/gl/window.c +++ b/src/gl/window.c @@ -98,6 +98,11 @@ int window_destroy(lua_State *L) void *ptr; hs_parse_args(L, hs_light(ptr)); GLFWwindow *win = ptr; + void *wdata = glfwGetWindowUserPointer(win); + if (wdata != NULL) { + free(wdata); + glfwSetWindowUserPointer(win, NULL); + } glfwDestroyWindow(win); return 0; } |