Free domains

Change-Id: Ide1743bbae89f41d2d6f62195ba4f7347d43cfda
This commit is contained in:
okozachenko 2020-08-13 22:22:12 +03:00
parent 5f09608a4a
commit 6aefcf98c1

View File

@ -340,6 +340,15 @@ func (c *DomainStatsCollector) Collect(ch chan<- prometheus.Metric) {
0,
)
defer func(stats []libvirt.DomainStats) {
for _, stat := range stats {
err := stat.Domain.Free()
if err != nil {
log.Errorln(err)
}
}
}(stats)
if err != nil {
log.Errorln(err)
return