aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/jalv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/jalv.c b/src/jalv.c
index ebb8f5e..3c5c004 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -1296,13 +1296,17 @@ jalv_close(Jalv* const jalv)
jalv_worker_finish(&jalv->worker);
// Deactivate audio
- jalv_backend_deactivate(jalv);
+ if (jalv->backend) {
+ jalv_backend_deactivate(jalv);
+ jalv_backend_close(jalv);
+ }
+
+ // Free event port buffers
for (uint32_t i = 0; i < jalv->num_ports; ++i) {
if (jalv->ports[i].evbuf) {
lv2_evbuf_free(jalv->ports[i].evbuf);
}
}
- jalv_backend_close(jalv);
// Destroy the worker
jalv_worker_destroy(&jalv->worker);