render worker context: allocate, and let worker threads free

Since we now initialize the worker threads from term_init(), which
returns before the threads terminate, we can no longer use
stack-allocated worker contexts.

We _could_ put them in the terminal struct. But a simpler solution is
to allocate them in term_init(), and let the threads free them when
they don't need them anymore.
This commit is contained in:
Daniel Eklöf 2019-10-28 18:48:43 +01:00
parent 720d0df067
commit 8e6f87eb17
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 6 additions and 4 deletions

View file

@ -374,6 +374,7 @@ render_worker_thread(void *_ctx)
struct render_worker_context *ctx = _ctx;
struct terminal *term = ctx->term;
const int my_id = ctx->my_id;
free(ctx);
char proc_title[16];
snprintf(proc_title, sizeof(proc_title), "foot:render:%d", my_id);