MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / Clear

Method Clear

src/Squirrel/ShellFile.cs:97–109  ·  view source on GitHub ↗

Called to clear the PropVariant's referenced and local memory. You must call Clear to avoid memory leaks.

()

Source from the content-addressed store, hash-verified

95 /// You must call Clear to avoid memory leaks.
96 /// </remarks>
97 public void Clear()
98 {
99 // Can't pass "this" by ref, so make a copy to call PropVariantClear with
100 PropVariant tmp = this;
101 PropVariantClear(ref tmp);
102
103 // Since we couldn't pass "this" by ref, we need to clear the member fields manually
104 // NOTE: PropVariantClear already freed heap data for us, so we are just setting
105 // our references to null.
106 variantType = (short)VarEnum.VT_EMPTY;
107 Reserved1 = Reserved2 = Reserved3 = 0;
108 pointerValue = IntPtr.Zero;
109 }
110 }
111
112 [StructLayout(LayoutKind.Sequential)]

Callers 2

SetupMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected