Fix removing OSWindow breaking pointer references in glfw
This commit is contained in:
parent
528573ac80
commit
c4bcda80e9
@ -48,9 +48,6 @@ update_os_window_viewport(OSWindow *window, bool notify_boss) {
|
|||||||
// callbacks {{{
|
// callbacks {{{
|
||||||
|
|
||||||
void
|
void
|
||||||
remove_os_window_reference(OSWindow *w) { if (w->handle) glfwSetWindowUserPointer(w->handle, NULL); }
|
|
||||||
|
|
||||||
static inline void
|
|
||||||
update_os_window_references() {
|
update_os_window_references() {
|
||||||
for (size_t i = 0; i < global_state.num_os_windows; i++) {
|
for (size_t i = 0; i < global_state.num_os_windows; i++) {
|
||||||
OSWindow *w = global_state.os_windows + i;
|
OSWindow *w = global_state.os_windows + i;
|
||||||
|
|||||||
@ -182,7 +182,6 @@ bool
|
|||||||
remove_os_window(id_type os_window_id) {
|
remove_os_window(id_type os_window_id) {
|
||||||
bool found = false;
|
bool found = false;
|
||||||
WITH_OS_WINDOW(os_window_id)
|
WITH_OS_WINDOW(os_window_id)
|
||||||
remove_os_window_reference(os_window);
|
|
||||||
found = true;
|
found = true;
|
||||||
make_os_window_context_current(os_window);
|
make_os_window_context_current(os_window);
|
||||||
END_WITH_OS_WINDOW
|
END_WITH_OS_WINDOW
|
||||||
@ -190,6 +189,7 @@ remove_os_window(id_type os_window_id) {
|
|||||||
WITH_OS_WINDOW_REFS
|
WITH_OS_WINDOW_REFS
|
||||||
REMOVER(global_state.os_windows, os_window_id, global_state.num_os_windows, OSWindow, destroy_os_window_item, global_state.capacity);
|
REMOVER(global_state.os_windows, os_window_id, global_state.num_os_windows, OSWindow, destroy_os_window_item, global_state.capacity);
|
||||||
END_WITH_OS_WINDOW_REFS
|
END_WITH_OS_WINDOW_REFS
|
||||||
|
update_os_window_references();
|
||||||
}
|
}
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -134,7 +134,7 @@ void gl_init();
|
|||||||
void remove_vao(ssize_t vao_idx);
|
void remove_vao(ssize_t vao_idx);
|
||||||
bool remove_os_window(id_type os_window_id);
|
bool remove_os_window(id_type os_window_id);
|
||||||
void make_os_window_context_current(OSWindow *w);
|
void make_os_window_context_current(OSWindow *w);
|
||||||
void remove_os_window_reference(OSWindow *w);
|
void update_os_window_references();
|
||||||
void mark_os_window_for_close(OSWindow* w, bool yes);
|
void mark_os_window_for_close(OSWindow* w, bool yes);
|
||||||
void update_os_window_viewport(OSWindow *window, bool);
|
void update_os_window_viewport(OSWindow *window, bool);
|
||||||
bool should_os_window_close(OSWindow* w);
|
bool should_os_window_close(OSWindow* w);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user