shithub: neindaw

Download patch

ref: 1330d1fff8e87caf7a85e4d32c17feb965484bae
parent: 8508e91aaf1ffbbd193791c19cfcbe161ef53160
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Aug 25 14:24:26 EDT 2021

fs: fix memory leak

--- a/fs.c
+++ b/fs.c
@@ -30,7 +30,7 @@
 static void
 shutup(State *s, Voice *v)
 {
-	if (s->voice != v) {
+	if (s->voice != v && v->dsp != nil) {
 		fs->dsp.free(v->dsp);
 		v->dsp = nil;
 	}
@@ -53,8 +53,8 @@
 			f = v;
 	}
 
+	shutup(s, f);
 	f->dsp = dsp;
-	f->state = Vsilent;
 
 	return f;
 }