Free global VAO on terminate
Some checks are pending
CI / Linux (python=3.14 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.13 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run

This commit is contained in:
Kovid Goyal 2026-07-07 19:53:32 +05:30
parent e9ca3a5d82
commit 28dc76fcf6
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 10 additions and 0 deletions

View file

@ -2133,6 +2133,7 @@ glfw_init(PyObject UNUSED *self, PyObject *args) {
static PyObject*
glfw_terminate(PYNOARG) {
cleanup_shader_resources_on_terminate();
for (size_t i = 0; i < arraysz(cursors); i++) {
if (cursors[i].is_custom && cursors[i].glfw) {
glfwDestroyCursor(cursors[i].glfw);

View file

@ -1867,6 +1867,14 @@ free_vao(ssize_t vao_idx) {
remove_vao(vao_idx);
}
void
cleanup_shader_resources_on_terminate(void) {
if (shader_globals_vao_idx != -1) {
remove_vao(shader_globals_vao_idx);
shader_globals_vao_idx = -1;
}
}
static void
finalize(void) {
default_visual_bell_animation = free_animation(default_visual_bell_animation);

View file

@ -555,6 +555,7 @@ sprite_index_to_pos(unsigned idx, unsigned xnum, unsigned ynum, unsigned *x, uns
void initialize_gpu(void);
void free_vao(ssize_t vao_idx);
void cleanup_shader_resources_on_terminate(void);
bool remove_os_window(id_type os_window_id);
void* make_os_window_context_current(OSWindow *w);
void set_os_window_size(OSWindow *os_window, int x, int y);