Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Moved writer inside try block to force disposal before file.Dispose()
  • Loading branch information
jamescrosswell committed Oct 6, 2024
commit f9111b4d566e79546fd051a6bb00ed2190ebdcde
3 changes: 1 addition & 2 deletions src/Sentry/GlobalSessionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ private void PersistSession(SessionUpdate update, DateTimeOffset? pauseTimestamp
return;
}

using var writer = new Utf8JsonWriter(file);

try
{
using var writer = new Utf8JsonWriter(file);
persistedSessionUpdate.WriteTo(writer, _options.DiagnosticLogger);
writer.Flush();
}
Expand Down