File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
Rubberduck.VBEEditor/ComManagement Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,14 @@ namespace Rubberduck.VBEditor.ComManagement
7
7
public static class ComMessagePumper
8
8
{
9
9
private static SynchronizationContext UiContext { get ; set ; }
10
- private static IVBERuntime Runtime { get ; set ; }
10
+ private static readonly Lazy < IVBERuntime > Runtime = new Lazy < IVBERuntime > ( ( ) => new VBERuntimeAccessor ( ) ) ;
11
11
12
12
public static void Initialize ( )
13
13
{
14
14
if ( UiContext == null )
15
15
{
16
16
UiContext = SynchronizationContext . Current ;
17
17
}
18
-
19
- Runtime = new VBERuntimeAccessor ( ) ;
20
18
}
21
19
22
20
/// <summary>
@@ -37,7 +35,7 @@ public static int PumpMessages()
37
35
{
38
36
CheckContext ( ) ;
39
37
40
- return Runtime . DoEvents ( ) ;
38
+ return Runtime . Value . DoEvents ( ) ;
41
39
}
42
40
43
41
private static void CheckContext ( )
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public VBERuntimeAccessor()
35
35
}
36
36
}
37
37
38
- private IVBERuntime DetermineVersion ( )
38
+ private static IVBERuntime DetermineVersion ( )
39
39
{
40
40
IVBERuntime runtime ;
41
41
try
You can’t perform that action at this time.
0 commit comments