From 5354a5731370090688ff74afb492074d13fc74c6 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 18 Jan 2018 18:35:18 +0100 Subject: [PATCH] plugin_unregister(): Stop I/O watcher before free():ing watcher Signed-off-by: Joachim Nilsson --- src/plugin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugin.c b/src/plugin.c index c2ef5b9d..18b2be7a 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -108,6 +108,9 @@ int plugin_register(plugin_t *plugin) /* Not called, at the moment plugins cannot be unloaded. */ int plugin_unregister(plugin_t *plugin) { + if (is_io_plugin(plugin)) + uev_io_stop(&plugin->watcher); + #ifndef ENABLE_STATIC TAILQ_REMOVE(&plugins, plugin, link);