# HG changeset patch # User Mike Becker # Date 1698685177 -3600 # Node ID bb2bfff31f1dd169ef6a037776b9c16d3491982b # Parent e3113d4e2fc0c6f8331c9d0058c0bbab63a73899 fix possible double-invocation of asc_window_destroy_impl() diff -r e3113d4e2fc0 -r bb2bfff31f1d src/core.c --- 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) {