Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit f99cf46

Browse files
Making Repository a parameter for DetachHandlers
1 parent aca3663 commit f99cf46

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ChangesView.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public override void OnEnable()
4747
public override void OnDisable()
4848
{
4949
base.OnDisable();
50-
DetachHandlers();
50+
DetachHandlers(Repository);
5151
}
5252

5353
private void AttachHandlers(IRepository repository)
@@ -57,11 +57,11 @@ private void AttachHandlers(IRepository repository)
5757
repository.OnStatusChanged += RunStatusUpdateOnMainThread;
5858
}
5959

60-
private void DetachHandlers()
60+
private void DetachHandlers(IRepository oldRepository)
6161
{
62-
if (Repository == null)
62+
if (oldRepository == null)
6363
return;
64-
Repository.OnStatusChanged -= RunStatusUpdateOnMainThread;
64+
oldRepository.OnStatusChanged -= RunStatusUpdateOnMainThread;
6565
}
6666

6767
private void RunStatusUpdateOnMainThread(GitStatus status)

0 commit comments

Comments
 (0)