Fix monkit leaking (#2553)

This commit is contained in:
Michal Niewrzal 2019-07-13 11:04:54 -04:00 committed by GitHub
parent 002d9748ec
commit 5bec820145
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -203,7 +203,7 @@ func (db *pieceinfo) SpaceUsed(ctx context.Context) (_ int64, err error) {
}
func (db *pieceinfo) loadSpaceUsed(ctx context.Context) {
defer mon.Task()(&ctx)
defer mon.Task()(&ctx)(nil)
db.space.once.Do(func() {
usedSpace, _ := db.CalculatedSpaceUsed(ctx)
atomic.AddInt64(&db.space.used, usedSpace)