summaryrefslogtreecommitdiff
path: root/src/modules/rtv
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-06-12 17:19:00 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-06-12 17:19:00 -0700
commit300b6beaf106c8fb89eb5da31ca327e7d68ec8b0 (patch)
tree20666ee43245f2a0a0b1e340801034ba86bf25b7 /src/modules/rtv
parentf806bf55ee2ada32b2fe9d4a13ccc84552d379d1 (diff)
modules/rtv: gc module contexts on channel switch
This probably needs more work, but this at a minimum should prevent us from leaking contexts in the stream at the myriad paths we construct them at. Context registration replaces what's at the existing path, but rtv produces all sorts of setup paths, and I haven't added any explicit unregistration of contexts at this time. That might change, but for now let's just use this gc mechanism even if it's a temporary hack.
Diffstat (limited to 'src/modules/rtv')
-rw-r--r--src/modules/rtv/rtv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/modules/rtv/rtv.c b/src/modules/rtv/rtv.c
index 9f7470b..12f5580 100644
--- a/src/modules/rtv/rtv.c
+++ b/src/modules/rtv/rtv.c
@@ -7,6 +7,7 @@
#include "til_fb.h"
#include "til_module_context.h"
#include "til_settings.h"
+#include "til_stream.h"
#include "til_util.h"
#include "txt/txt.h"
@@ -218,6 +219,8 @@ static void setup_next_channel(rtv_context_t *ctxt, unsigned ticks)
if (!ctxt->channel->module_ctxt)
(void) til_module_create_context(ctxt->channel->module, ctxt->til_module_context.stream, rand_r(&ctxt->til_module_context.seed), ticks, ctxt->til_module_context.n_cpus, ctxt->channel->module_setup, &ctxt->channel->module_ctxt);
+ til_stream_gc_module_contexts(ctxt->til_module_context.stream);
+
ctxt->channel->last_on_time = now;
}
© All Rights Reserved