Merge pull request #2573 from BrzVlad/fix-conc-memusage
[mono.git] / mcs / class / corlib / System / __ComObject.cs
index 91360a9c218db82906c7a23738cebee7bd955614..18f0c43ec49761d5097b6a32b97c2910c4031816 100644 (file)
@@ -32,6 +32,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !FULL_AOT_RUNTIME
 using Mono.Interop;
 using System.Collections;
 using System.Runtime.InteropServices;
@@ -99,6 +100,8 @@ namespace System
                        // Guard multiple invocation.
                        if (iunknown != IntPtr.Zero)
                                return;
+
+                       System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (t.TypeHandle);
                        
                        ObjectCreationDelegate ocd = ExtensibleClassFactory.GetObjectCreationCallback (t);
                        if (ocd != null) {
@@ -227,3 +230,4 @@ namespace System
                        out IntPtr pUnk);
        }
 }
+#endif