()
| 44 | } |
| 45 | |
| 46 | func (ss *segmentStack) decRef() { |
| 47 | ss.m.Lock() |
| 48 | ss.refs-- |
| 49 | if ss.refs <= 0 { |
| 50 | if ss.stats != nil { // Only update stats if snapshot is on collection. |
| 51 | atomic.AddUint64(&ss.stats.TotSnapshotInternalClose, 1) |
| 52 | } |
| 53 | if ss.lowerLevelSnapshot != nil { |
| 54 | ss.lowerLevelSnapshot.Close() |
| 55 | ss.lowerLevelSnapshot = nil |
| 56 | } |
| 57 | } |
| 58 | ss.m.Unlock() |
| 59 | } |
| 60 | |
| 61 | // ------------------------------------------------------ |
| 62 |