diff options
Diffstat (limited to 'frontends/monkey/dispatch.c')
-rw-r--r-- | frontends/monkey/dispatch.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/frontends/monkey/dispatch.c b/frontends/monkey/dispatch.c index e60325cf1..08bd352d5 100644 --- a/frontends/monkey/dispatch.c +++ b/frontends/monkey/dispatch.c @@ -29,7 +29,7 @@ typedef struct cmdhandler { struct cmdhandler *r_next, *r_prev; - const char *cmd; + char *cmd; handle_command_fn fn; } monkey_cmdhandler_t; @@ -50,6 +50,17 @@ monkey_register_handler(const char *cmd, handle_command_fn fn) } void +monkey_free_handlers(void) +{ + while (handler_ring != NULL) { + monkey_cmdhandler_t *handler = handler_ring; + RING_REMOVE(handler_ring, handler); + free(handler->cmd); + free(handler); + } +} + +void monkey_process_command(void) { char buffer[PATH_MAX]; |