Skip to content

Commit e88e41a

Browse files
committed
Made the ComSafeManager return a WeakComSafe.
1 parent d1bcb64 commit e88e41a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
3+
namespace Rubberduck.VBEditor.ComManagement
4+
{
5+
public static class ComSafeManager
6+
{
7+
private static Lazy<IComSafe> _comSafe = new Lazy<IComSafe>(NewComSafe);
8+
9+
public static IComSafe GetCurrentComSafe()
10+
{
11+
return _comSafe.Value;
12+
}
13+
14+
public static void ResetComSafe()
15+
{
16+
_comSafe = new Lazy<IComSafe>(NewComSafe);
17+
}
18+
19+
private static IComSafe NewComSafe()
20+
{
21+
return new WeakComSafe();
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)