Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 4d4a864

Browse files
committed
PullRequestSession is shared and shouldn't be disposed
1 parent 3d00bf7 commit 4d4a864

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

src/GitHub.InlineReviews/Services/PullRequestSession.cs

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ namespace GitHub.InlineReviews.Services
2121
/// It takes the pull request model and updates according to the current state of the
2222
/// repository on disk and in the editor.
2323
/// </remarks>
24-
public class PullRequestSession : ReactiveObject, IPullRequestSession, IDisposable
24+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1001:TypesThatOwnDisposableFieldsShouldBeDisposable",
25+
Justification = "PullRequestSession is shared and shouldn't be disposed")]
26+
public class PullRequestSession : ReactiveObject, IPullRequestSession
2527
{
2628
readonly IPullRequestSessionService service;
2729
readonly Dictionary<string, PullRequestSessionFile> fileIndex = new Dictionary<string, PullRequestSessionFile>();
@@ -160,28 +162,6 @@ public async Task Update(IPullRequestModel pullRequestModel)
160162
pullRequestChanged.OnNext(pullRequestModel);
161163
}
162164

163-
public void Dispose()
164-
{
165-
Dispose(true);
166-
GC.SuppressFinalize(this);
167-
}
168-
169-
bool disposed = false;
170-
171-
protected virtual void Dispose(bool disposing)
172-
{
173-
if (!disposed)
174-
{
175-
disposed = true;
176-
177-
if (disposing)
178-
{
179-
getFilesLock.Dispose();
180-
pullRequestChanged.Dispose();
181-
}
182-
}
183-
}
184-
185165
async Task AddComment(IPullRequestReviewCommentModel comment)
186166
{
187167
PullRequest.ReviewComments = PullRequest.ReviewComments

0 commit comments

Comments
 (0)