Mon, 30 Oct 2023 17:59:37 +0100
fix possible double-invocation of asc_window_destroy_impl()
src/core.c | file | annotate | diff | comparison | revisions |
--- a/src/core.c Mon Oct 30 17:40:34 2023 +0100 +++ b/src/core.c Mon Oct 30 17:59:37 2023 +0100 @@ -266,14 +266,15 @@ void asc_window_destroy(AscWindow* window) { // find the window in the context and remove it + bool found = false; CxMutIterator iter = cxListMutIterator(asc_context.windows); cx_foreach(AscWindow*, w, iter) { if (w == window) { - asc_dprintf("Window %u removed from context.", window->id); + found = true; cxIteratorFlagRemoval(iter); } } - asc_window_destroy_impl(window); + if (!found) asc_window_destroy_impl(window); } void asc_window_sync(AscWindow const* window) {