Skip to content

Commit 9e05bc1

Browse files
committed
Move XlCall.ShutdownStarted around a bit
1 parent 8fd3073 commit 9e05bc1

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Source/ExcelDna.IntelliSense/IntelliSenseServer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,14 @@ public static void Refresh()
117117

118118
private static void CurrentDomain_ProcessExit(object sender, EventArgs e)
119119
{
120+
120121
// CONSIDER: We get this quite late in the shutdown
121122
// We should try to find a way to identify Excel shutdown a lot earlier
122123
Logger.Initialization.Verbose("IntelliSenseServer ProcessExit Begin");
123124
if (_isActive)
124125
{
126+
// Parachute in asap a call to prevent further XLPenHelper calls
127+
XlCall.ShutdownStarted();
125128
Deactivate();
126129
}
127130
Logger.Initialization.Verbose("IntelliSenseServer ProcessExit End");

Source/ExcelDna.IntelliSense/UIMonitor/FormulaEditWatcher.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ void OnStateChanged(StateChangeEventArgs stateChangeEventArgs)
412412
public void Dispose()
413413
{
414414
Logger.WindowWatcher.Verbose("FormulaEdit Dispose Begin");
415-
XlCall.ShutdownStarted();
416415

417416
// Not sure we need this:
418417
_windowWatcher.FormulaBarWindowChanged -= _windowWatcher_FormulaBarWindowChanged;

Source/ExcelDna.IntelliSense/UIMonitor/XlCall.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct FmlaInfo
3434
// Maybe helps with debugging...
3535
static bool _shutdownStarted = false;
3636
public static void ShutdownStarted()
37-
{
37+
{
3838
_shutdownStarted = true;
3939
}
4040

0 commit comments

Comments
 (0)