From 60e0a7e97c911bb71a7d8d066d555ffe19d873b0 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 24 May 2016 15:47:41 -0700 Subject: [PATCH] Fix potential leak/null reference when switching projects **Bug** We can end up hitting a null dereference when switching projects for a project with a symlink watcher. This happens because we null out the `ItemNode` before destroying the symlink watcher. **Fix** Reorder the operations. We should destory the symlink watcher and then null out the nodes. --- Common/Product/SharedProject/CommonFolderNode.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/Product/SharedProject/CommonFolderNode.cs b/Common/Product/SharedProject/CommonFolderNode.cs index 1569e690b..cfbe68603 100644 --- a/Common/Product/SharedProject/CommonFolderNode.cs +++ b/Common/Product/SharedProject/CommonFolderNode.cs @@ -239,10 +239,10 @@ public override void Remove(bool removeFromStorage) { } public override void Close() { - base.Close(); - // make sure this thing isn't hanging around... ProjectMgr.TryDeactivateSymLinkWatcher(this); + + base.Close(); } ///