aboutsummaryrefslogtreecommitdiffstats
path: root/core/reference.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/reference.go')
-rw-r--r--core/reference.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/reference.go b/core/reference.go
index c33402c..16b60ac 100644
--- a/core/reference.go
+++ b/core/reference.go
@@ -182,8 +182,9 @@ func (iter *ReferenceSliceIter) Next() (*Reference, error) {
// ForEach call the cb function for each reference contained on this iter until
// an error happends or the end of the iter is reached. If ErrStop is sent
-// the iteration is stop but no error is returned
+// the iteration is stop but no error is returned. The iterator is closed.
func (iter *ReferenceSliceIter) ForEach(cb func(*Reference) error) error {
+ defer iter.Close()
for _, r := range iter.series {
if err := cb(r); err != nil {
if err == ErrStop {