MCPcopy Create free account
hub / github.com/microsoft/typescript-go / Close

Method Close

internal/api/session.go:2855–2864  ·  view source on GitHub ↗

Close closes the session and releases all active snapshots, regardless of their ref counts.

()

Source from the content-addressed store, hash-verified

2853// Close closes the session and releases all active snapshots,
2854// regardless of their ref counts.
2855func (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

Calls 4

releaseOpenRefsMethod · 0.95
LockMethod · 0.45
UnlockMethod · 0.45
DerefMethod · 0.45