From f74e08d70a9dfd8a99c415802038caf4d174f6ee Mon Sep 17 00:00:00 2001
From: Scott <scott@ausocean.org>
Date: Fri, 27 Dec 2019 16:48:28 +1030
Subject: [PATCH] Filter safely closes.

---
 revid/revid.go | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/revid/revid.go b/revid/revid.go
index 07f2f652..756a51b0 100644
--- a/revid/revid.go
+++ b/revid/revid.go
@@ -484,10 +484,13 @@ func (r *Revid) Stop() {
 		r.cfg.Logger.Log(logger.Error, pkg+"failed to close pipeline", "error", err.Error())
 	}
 
-	//err = r.filter.Close()
-	if err != nil {
-		r.cfg.Logger.Log(logger.Error, pkg+"failed to close pipeline", "error", err.Error())
+	for _, filter := range r.filters {
+		err = filter.Close()
+		if err != nil {
+			r.cfg.Logger.Log(logger.Error, pkg+"failed to close pipeline", "error", err.Error())
+		}
 	}
+
 	r.cfg.Logger.Log(logger.Info, pkg+"closed pipeline")
 
 	if r.cmd != nil && r.cmd.Process != nil {