webui icon indicating copy to clipboard operation
webui copied to clipboard

data race when memory alloc/free (ws non-blocking mode)

Open jimying opened this issue 1 year ago • 1 comments

In ws non-blocking mode (win->ws_block = false), WEBUI_WS_DATA will process in new thread (_webui_ws_process_thread), which call _webui_free_mem() to free memory. If muti-threads free and main thread _webui_malloc() to alloc memory, maybe cause data race error (may crash).

we should add a mutex lock.

jimying avatar Oct 21 '24 07:10 jimying