diff --git a/externals/ggee/control/shell.c b/externals/ggee/control/shell.c
index f71ddceed9de1528235f9e345b814140d7a423de..8ecb52bd14124733e610be4676b5acbf70ef078f 100644
--- a/externals/ggee/control/shell.c
+++ b/externals/ggee/control/shell.c
@@ -272,6 +272,11 @@ static void shell_anything(t_shell *x, t_symbol *s, int ac, t_atom *at)
 
 void shell_free(t_shell* x)
 {
+    if (x->fdpipe[0] != -1)
+    { 
+        kill(x->pid,SIGKILL);
+        shell_cleanup(x);
+    }
     binbuf_free(x->x_binbuf);
 }