Skip to content

Commit 8e0561c

Browse files
committed
Add extra Automation event cleanup
1 parent 19a70fa commit 8e0561c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Source/ExcelDna.IntelliSense.Host/ExcelDna.IntelliSense.Host.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@
6060
</Content>
6161
</ItemGroup>
6262
<ItemGroup>
63-
<None Include="ExcelDna.IntelliSense.Host-AddIn.xll.config">
64-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
65-
</None>
6663
<None Include="packages.config" />
6764
</ItemGroup>
6865
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

Source/ExcelDna.IntelliSense/UIMonitor/UIMonitor.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Linq;
55
using System.Threading;
66
using System.Windows;
7+
using System.Windows.Automation;
78

89
namespace ExcelDna.IntelliSense
910
{
@@ -645,6 +646,9 @@ public void Dispose()
645646
_popupListWatcher.Dispose();
646647
_popupListWatcher = null;
647648
}
649+
// Try to clean up any stray event handlers too...
650+
Automation.RemoveAllEventHandlers();
651+
648652
}, null);
649653

650654
// Let the above delegate and nested calls run, then clean up.

0 commit comments

Comments
 (0)