Skip to content

Commit

Permalink
fix potential snapshot leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Termina1 committed Dec 19, 2024
1 parent faf7a12 commit 18a8501
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions orm.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ func (orm *ORM) Clear() error {
return ErrClosed
}
orm.objects.Clear()
if orm.Snap != nil {
_ = orm.Snap.Close()
}
orm.Snap = orm.Host.Database().NewSnapshot()
return nil
}
Expand Down

0 comments on commit 18a8501

Please sign in to comment.