From 7231e59fecf19de0077f8eae3baed952155fa62b Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 14 Aug 2023 08:20:52 -0700 Subject: modules/rkt: wire up pipe_dtor to stop leaking rkt_pipe_t On shutdown til_stream_untap_owner() will call into the pipe_dtor hook if set. So until now this was just (harmlessly) leaking the rkt_pipe_t allocated by the pipe_ctor hook on the road to process exit. But in the interests of silencing ASAN about leaks on graceful exit, I'm tying up these loose ends. This dtor will also be utilized for performing a FORGET_TRACK via Rocket once that's a thing. While here I also got rid of the pipe_dtor return value, as it's unused with no clear potential purpose (for now). --- src/til_stream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/til_stream.h') diff --git a/src/til_stream.h b/src/til_stream.h index eab078c..f9717af 100644 --- a/src/til_stream.h +++ b/src/til_stream.h @@ -41,7 +41,7 @@ typedef int (til_stream_pipe_iter_func_t)(void *context, til_stream_pipe_t *pipe */ typedef struct til_stream_hooks_t { int (*pipe_ctor)(void *context, til_stream_t *stream, const void *owner, const void *owner_foo, const char *parent_path, uint32_t parent_hash, const til_tap_t *tap, const void **res_owner, const void **res_owner_foo, const til_tap_t **res_tap); /* called immediately *before* pipe would be created by tap using these parameters, return <0 on error, 0 on unhandled by hook, 1 on handled with desired owner/owner_foo/tap stored in res_* */ - int (*pipe_dtor)(void *context, til_stream_t *stream, const void *owner, const void *owner_foo, const char *parent_path, const til_tap_t *tap); /* called immediately *after* pipe "destroyed" (withdrawn from stream) */ + void (*pipe_dtor)(void *context, til_stream_t *stream, const void *owner, const void *owner_foo, const char *parent_path, const til_tap_t *tap); /* called immediately *after* pipe "destroyed" (withdrawn from stream) */ } til_stream_hooks_t; til_stream_t * til_stream_new(void); -- cgit v1.2.1