From 736417485850c487b4dd39463f1a4fd8b05e4f6d Mon Sep 17 00:00:00 2001 From: Scott Date: Fri, 20 Dec 2019 15:37:49 +1030 Subject: [PATCH] Filters shall close when revid stops. The Stop method for revid calls the filter's Close method to free filter resources. --- filter/mog.go | 2 +- revid/revid.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/filter/mog.go b/filter/mog.go index a6343ce0..7ae23ce2 100644 --- a/filter/mog.go +++ b/filter/mog.go @@ -65,7 +65,7 @@ func (m *MOGFilter) Close() error { for _, window := range m.windows { window.Close() } - return m.dst.Close() + return nil } // Implements io.Writer. diff --git a/revid/revid.go b/revid/revid.go index 61e3be3e..55b46656 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -450,6 +450,10 @@ func (r *Revid) Stop() { if err != nil { 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()) + } r.cfg.Logger.Log(logger.Info, pkg+"closed pipeline") if r.cmd != nil && r.cmd.Process != nil {