bugfix: copy binding before run

Copy the binding struct before running it and use this copy to emit the
binding event.

This fixes a crash when the command `reload` is used in a binding when
the binding event is emitted.
This commit is contained in:
Tony Crisci
2014-11-10 00:04:47 -05:00
committed by Michael Stapelberg
parent 0125530409
commit bb1f857b00
4 changed files with 83 additions and 6 deletions

View File

@ -60,6 +60,11 @@ void switch_mode(const char *new_mode);
*/
void check_for_duplicate_bindings(struct context *context);
/**
* Frees the binding. If bind is null, it simply returns.
*/
void binding_free(Binding *bind);
/**
* Runs the given binding and handles parse errors. If con is passed, it will
* execute the command binding with that container selected by criteria.