Filters shall close when revid stops.

The Stop method for revid calls the filter's Close method to free filter resources.
This commit is contained in:
Scott 2019-12-20 15:37:49 +10:30
parent cbe36f03b0
commit 7364174858
2 changed files with 5 additions and 1 deletions

View File

@ -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.

View File

@ -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 {