Close closes the session and releases all active snapshots, regardless of their ref counts.
()
| 2853 | // Close closes the session and releases all active snapshots, |
| 2854 | // regardless of their ref counts. |
| 2855 | func (s *Session) Close() { |
| 2856 | s.releaseOpenRefs() |
| 2857 | |
| 2858 | s.snapshotsMu.Lock() |
| 2859 | defer s.snapshotsMu.Unlock() |
| 2860 | for handle, sd := range s.snapshots { |
| 2861 | sd.snapshot.Deref(s.projectSession) |
| 2862 | delete(s.snapshots, handle) |
| 2863 | } |
| 2864 | } |
| 2865 | |
| 2866 | // releaseOpenRefs releases every project and file ref this session is holding open |
| 2867 | // in the project session. This keeps the API's ref counts balanced when an API |