Delete extrafields when custom module is deactivated

Hello.

I have a question. If I create extra fields in modMymodsuleName.class.php when my custom module is activated, how can I delete them on module deactivation?

This is the file that creates the extra fields - dolibarr/modMyModule.class.php at develop · Dolibarr/dolibarr · GitHub (starting from line 420)

Hello,

In the remove function add

include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$result1=$extrafields-> delete('mymodule_myattr1',  'thirdparty');