diff --git a/src/Mono.Android/Android.Runtime/AndroidRuntime.cs b/src/Mono.Android/Android.Runtime/AndroidRuntime.cs index a594902af07..6561e2b8fbd 100644 --- a/src/Mono.Android/Android.Runtime/AndroidRuntime.cs +++ b/src/Mono.Android/Android.Runtime/AndroidRuntime.cs @@ -187,6 +187,7 @@ public override JniObjectReference CreateGlobalReference (JniObjectReference val int gc = RuntimeNativeMethods._monodroid_gref_log_new (value.Handle, ctype, r.Handle, ntype, tname, tid, from, 1); if (gc >= JNIEnvInit.gref_gc_threshold) { Logger.Log (LogLevel.Warn, "monodroid-gc", gc + " outstanding GREFs. Performing a full GC!"); + System.GC.WaitForPendingFinalizers (); System.GC.Collect (); }