aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/maweb.c
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-12-11 23:24:23 +0100
committercbdev <cb@cbcdn.com>2019-12-11 23:24:23 +0100
commit9624d46436576b415c639ea7390012cdd95c88f7 (patch)
treefb3aadbaf01fcee5da8ecdb8355ff191341b666d /backends/maweb.c
parent48e12201f5c57cda581bc0c713d99da6524c49a8 (diff)
parentf6d6eefe9bb9934f4fa3e665734d746f02471cdb (diff)
downloadmidimonster-9624d46436576b415c639ea7390012cdd95c88f7.tar.gz
midimonster-9624d46436576b415c639ea7390012cdd95c88f7.tar.bz2
midimonster-9624d46436576b415c639ea7390012cdd95c88f7.zip
Merge branch 'master' into rtpmidi
Diffstat (limited to 'backends/maweb.c')
-rw-r--r--backends/maweb.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/backends/maweb.c b/backends/maweb.c
index d008cc0..8cf201e 100644
--- a/backends/maweb.c
+++ b/backends/maweb.c
@@ -989,17 +989,10 @@ static int maweb_handle(size_t num, managed_fd* fds){
return rv;
}
-static int maweb_start(){
- size_t n, u, p;
- instance** inst = NULL;
+static int maweb_start(size_t n, instance** inst){
+ size_t u, p;
maweb_instance_data* data = NULL;
- //fetch all defined instances
- if(mm_backend_instances(BACKEND_NAME, &n, &inst)){
- fprintf(stderr, "Failed to fetch instance list\n");
- return 1;
- }
-
for(u = 0; u < n; u++){
//sort channels
data = (maweb_instance_data*) inst[u]->impl;
@@ -1017,11 +1010,6 @@ static int maweb_start(){
}
}
- free(inst);
- if(!n){
- return 0;
- }
-
fprintf(stderr, "maweb backend registering %" PRIsize_t " descriptors to core\n", n);
//initialize timeouts
@@ -1029,17 +1017,10 @@ static int maweb_start(){
return 0;
}
-static int maweb_shutdown(){
- size_t n, u;
- instance** inst = NULL;
+static int maweb_shutdown(size_t n, instance** inst){
+ size_t u;
maweb_instance_data* data = NULL;
- //fetch all instances
- if(mm_backend_instances(BACKEND_NAME, &n, &inst)){
- fprintf(stderr, "Failed to fetch instance list\n");
- return 1;
- }
-
for(u = 0; u < n; u++){
data = (maweb_instance_data*) inst[u]->impl;
free(data->host);
@@ -1065,8 +1046,6 @@ static int maweb_shutdown(){
data->channels = 0;
}
- free(inst);
-
fprintf(stderr, "maweb backend shut down\n");
return 0;
}