Skip to content

Commit 17114c1

Browse files
committed
custom: plugins: Add cb_destroy callback for Golang custom plugins
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent 8d4db49 commit 17114c1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

include/fluent-bit/flb_custom.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ struct flb_custom_plugin {
6060
void *, struct flb_config *);
6161
int (*cb_exit) (void *, struct flb_config *);
6262

63+
/* Destroy */
64+
void (*cb_destroy) (struct flb_custom_plugin *);
65+
6366
struct mk_list _head; /* Link to parent list (config->custom) */
6467
};
6568

include/fluent-bit/flb_plugins.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ void flb_plugins_unregister(struct flb_config *config)
6464

6565
mk_list_foreach_safe(head, tmp, &config->custom_plugins) {
6666
custom = mk_list_entry(head, struct flb_custom_plugin, _head);
67+
if(custom->cb_destroy) {
68+
custom->cb_destroy(custom);
69+
}
6770
mk_list_del(&custom->_head);
6871
flb_free(custom);
6972
}

0 commit comments

Comments
 (0)