From 183a69a51f2427a188f796ae51dcacca742c464e Mon Sep 17 00:00:00 2001 From: derselbst Date: Tue, 12 Jun 2018 06:37:24 +0200 Subject: [PATCH] avoid leaking midi_router in fluidsynth.c --- src/fluidsynth.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/fluidsynth.c b/src/fluidsynth.c index ec905023..a2b33a58 100644 --- a/src/fluidsynth.c +++ b/src/fluidsynth.c @@ -39,9 +39,6 @@ #include "fluid_lash.h" -#ifndef WITH_MIDI -#define WITH_MIDI 1 -#endif void print_usage(void); void print_help(fluid_settings_t *settings); @@ -621,7 +618,6 @@ int main(int argc, char** argv) } /* start the midi router and link it to the synth */ -#if WITH_MIDI if (midi_in && router != NULL) { /* In dump mode, text output is generated for events going into and out of the router. * The example dump functions are put into the chain before and after the router.. @@ -637,7 +633,6 @@ int main(int argc, char** argv) "through the console.\n"); } } -#endif /* play the midi files, if any */ for (i = arg1; i < argc; i++) { @@ -763,13 +758,12 @@ int main(int argc, char** argv) delete_fluid_player(player); } - if (router) { -#if WITH_MIDI if (mdriver) { delete_fluid_midi_driver(mdriver); } + + if (router) { delete_fluid_midi_router(router); -#endif } /*if (sequencer) {