- mono_runtime_invoke (mono_class_get_finalizer (o->vtable->klass), o, NULL, &exc);
+ finalizer = mono_class_get_finalizer (o->vtable->klass);
+
+ /* If object has a CCW but has no finalizer, it was only
+ * registered for finalization in order to free the CCW.
+ * Else it needs the regular finalizer run.
+ * FIXME: what to do about ressurection and suppression
+ * of finalizer on object with CCW.
+ */
+ if (mono_marshal_free_ccw (o) && !finalizer)
+ return;
+
+ mono_runtime_invoke (finalizer, o, NULL, &exc);