summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/rkt/rkt.c17
-rw-r--r--src/til_stream.h2
2 files changed, 16 insertions, 3 deletions
diff --git a/src/modules/rkt/rkt.c b/src/modules/rkt/rkt.c
index d5c42d5..3a48606 100644
--- a/src/modules/rkt/rkt.c
+++ b/src/modules/rkt/rkt.c
@@ -134,7 +134,7 @@ typedef struct rkt_pipe_t {
} rkt_pipe_t;
-int rkt_stream_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_driving_tap)
+static int rkt_stream_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_driving_tap)
{
rkt_context_t *ctxt = context;
rkt_pipe_t *rkt_pipe;
@@ -165,10 +165,23 @@ int rkt_stream_pipe_ctor(void *context, til_stream_t *stream, const void *owner,
return 1;
}
+static void rkt_stream_pipe_dtor(void *context, til_stream_t *stream, const void *owner, const void *owner_foo, const char *parent_path, const til_tap_t *tap)
+{
+ rkt_context_t *ctxt = context;
+
+ assert(stream);
+ assert(tap);
+
+ if (owner != ctxt)
+ return; /* not interesting to us */
+
+ free((void *)owner_foo);
+}
+
static const til_stream_hooks_t rkt_stream_hooks = {
.pipe_ctor = rkt_stream_pipe_ctor,
- /* .pipe_dtor unneeded */
+ .pipe_dtor = rkt_stream_pipe_dtor,
};
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);
© All Rights Reserved