let unlink_vtable = fun vtable ->
    let (vtables, to_be_removed) =
      List.partition (fun vt -> vt.vt_name <> vtable.vt_name)
        vtable.vt_db.db_vtables
    in
      vtable.vt_db.db_vtables <- vtables;
      match to_be_removed with
        | [vt] -> vt.vt_db <- (Obj.magic 0)
        | _    -> Dbf_misc.ie ()