aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/loopback.c
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-03-23 00:15:00 +0100
committercbdev <cb@cbcdn.com>2020-03-23 00:15:00 +0100
commit37e712edf23a49be5387f945ab9ea57cc0b57f22 (patch)
tree5037b14bdbd08baa8f104f7e4946aa5643281a94 /backends/loopback.c
parent666aec036f9bf0de82c435bd7eace271613cee1e (diff)
parentaa02ccf3abf183207b24fcbb9460cbd904a698e2 (diff)
downloadmidimonster-37e712edf23a49be5387f945ab9ea57cc0b57f22.tar.gz
midimonster-37e712edf23a49be5387f945ab9ea57cc0b57f22.tar.bz2
midimonster-37e712edf23a49be5387f945ab9ea57cc0b57f22.zip
Merge current master
Diffstat (limited to 'backends/loopback.c')
-rw-r--r--backends/loopback.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/backends/loopback.c b/backends/loopback.c
index 085d1df..4274832 100644
--- a/backends/loopback.c
+++ b/backends/loopback.c
@@ -34,19 +34,14 @@ static int loopback_configure_instance(instance* inst, char* option, char* value
return 0;
}
-static instance* loopback_instance(){
- instance* i = mm_instance();
- if(!i){
- return NULL;
- }
-
- i->impl = calloc(1, sizeof(loopback_instance_data));
- if(!i->impl){
+static int loopback_instance(instance* inst){
+ inst->impl = calloc(1, sizeof(loopback_instance_data));
+ if(!inst->impl){
LOG("Failed to allocate memory");
- return NULL;
+ return 1;
}
- return i;
+ return 0;
}
static channel* loopback_channel(instance* inst, char* spec, uint8_t flags){
@@ -107,6 +102,7 @@ static int loopback_shutdown(size_t n, instance** inst){
}
free(data->name);
free(inst[u]->impl);
+ inst[u]->impl = NULL;
}
LOG("Backend shut down");