aboutsummaryrefslogtreecommitdiffhomepage
path: root/midimonster.c
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2017-06-05 16:37:02 +0200
committercbdev <cb@cbcdn.com>2017-06-05 16:37:02 +0200
commited55916e772264dc8278fc8c96d4139aec31e89e (patch)
tree9c003bc1e41aceb9a0af3a664785dcd76c03b8f6 /midimonster.c
parentc47b0765a8605b9afcc6205a6d2396ccbe3d5e05 (diff)
downloadmidimonster-ed55916e772264dc8278fc8c96d4139aec31e89e.tar.gz
midimonster-ed55916e772264dc8278fc8c96d4139aec31e89e.tar.bz2
midimonster-ed55916e772264dc8278fc8c96d4139aec31e89e.zip
Backend channel spec parsing
Diffstat (limited to 'midimonster.c')
-rw-r--r--midimonster.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/midimonster.c b/midimonster.c
index aeaf04d..367ca6f 100644
--- a/midimonster.c
+++ b/midimonster.c
@@ -50,6 +50,16 @@ int mm_map_channel(channel* from, channel* to){
return 0;
}
+void map_free(){
+ size_t u;
+ for(u = 0; u < mappings; u++){
+ free(map[u].to);
+ }
+ free(map);
+ mappings = 0;
+ map = NULL;
+}
+
int usage(char* fn){
fprintf(stderr, "MIDIMonster v0.1\n");
fprintf(stderr, "Usage:\n");
@@ -75,7 +85,9 @@ int main(int argc, char** argv){
if(config_read(cfg_file)){
fprintf(stderr, "Failed to read configuration file %s\n", cfg_file);
backends_stop();
+ channels_free();
instances_free();
+ map_free();
return usage(argv[0]);
}
@@ -93,6 +105,7 @@ bail:
backends_stop();
channels_free();
instances_free();
+ map_free();
return rv;
}