We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 927b1c5 commit ada0d61Copy full SHA for ada0d61
src/tests/Interop/COM/ComWrappers/Common.cs
@@ -21,9 +21,10 @@ class Test : ITest, ICustomQueryInterface
21
{
22
public static int InstanceCount = 0;
23
24
+ private int id;
25
private int value = -1;
- public Test() { InstanceCount++; }
26
- ~Test() { InstanceCount--; }
+ public Test() { id = Interlocked.Increment(ref InstanceCount); }
27
+ ~Test() { Interlocked.Decrement(ref InstanceCount); id = -1; }
28
29
public void SetValue(int i) => this.value = i;
30
public int GetValue() => this.value;
0 commit comments