How to effectively remove module created fields? During the installation procedure of a module one may create some fields and corresponding instances and attach them to a content type. What is the best practice to clear up what we have created after module uninstallation?

It seems that removing fields created by a module is not yet implemented in D7 (see field_modules_uninstalled docs.). What would be the best approach then to remove module fields?


field_attach_delete_bundle


OR


field_delete_field


NOTE:
the comment module removes the field upon uninstallation (see here).
This is the code snippet I usually use to remove fields created by a custom module:

if (field_info_field('my_field_name')) {
    field_delete_field('my_field_name');
    field_purge_batch(100);
}


Hope this helps