提交 d1950444 编写于 作者: K Kevin Pilch-Bisson

Don't disconnect and reconnect to the same workspace.

This hopefully fixes #9723, because there won't be the chance that the
WorkspaceRegistrationChanged event will fire *after* the first TagsChanged
instead of before.
上级 5089294c
......@@ -95,9 +95,17 @@ internal partial class TagComputer
private void OnWorkspaceRegistrationChanged(object sender, EventArgs e)
{
DisconnectFromWorkspace();
// We both try to connect synchronously, and register for workspace registration events.
// It's possible (particularly in tests), to connect in the startup path, but then get a
// previously scheduled, but not yet delivered event. Don't bother connecting to the
// same workspace again in that case.
var newWorkspace = _workspaceRegistration.Workspace;
if (newWorkspace == _workspace)
{
return;
}
DisconnectFromWorkspace();
if (newWorkspace != null)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册