Index: ossp-pkg/l2/l2_ch_buffer.c RCS File: /v/ossp/cvs/ossp-pkg/l2/l2_ch_buffer.c,v rcsdiff -q -kk '-r1.17' '-r1.18' -u '/v/ossp/cvs/ossp-pkg/l2/l2_ch_buffer.c,v' 2>/dev/null --- l2_ch_buffer.c 2001/09/06 16:10:05 1.17 +++ l2_ch_buffer.c 2001/09/11 11:59:59 1.18 @@ -175,6 +175,8 @@ static l2_result_t hook_destroy(l2_context_t *ctx, l2_channel_t *ch) { l2_ch_buffer_t *cfg = (l2_ch_buffer_t *)ctx->vp; + l2_channel_t *downstream = l2_channel_downstream(ch); + l2_result_t rv; /* if not already closed, close channel buffer now */ if (cfg->buf != NULL) { @@ -185,6 +187,10 @@ /* destroy channel configuration */ free(cfg); + /* optionally destroy downstream channel, too */ + if ((rv = l2_channel_destroy(downstream)) != L2_OK) + return rv; + return L2_OK; } Index: ossp-pkg/l2/l2_ch_prefix.c RCS File: /v/ossp/cvs/ossp-pkg/l2/l2_ch_prefix.c,v rcsdiff -q -kk '-r1.10' '-r1.11' -u '/v/ossp/cvs/ossp-pkg/l2/l2_ch_prefix.c,v' 2>/dev/null --- l2_ch_prefix.c 2001/09/06 16:10:05 1.10 +++ l2_ch_prefix.c 2001/09/11 11:59:59 1.11 @@ -119,6 +119,8 @@ static l2_result_t hook_destroy(l2_context_t *ctx, l2_channel_t *ch) { l2_ch_prefix_t *cfg = (l2_ch_prefix_t *)ctx->vp; + l2_channel_t *downstream = l2_channel_downstream(ch); + l2_result_t rv; /* free prefix structure */ if (cfg->timefmt != NULL) @@ -127,6 +129,10 @@ free(cfg->timezone); free(cfg); + /* optionally destroy downstream channel, too */ + if ((rv = l2_channel_destroy(downstream)) != L2_OK) + return rv; + return L2_OK; }