Respond to user role deletion.
This hook allows you act when a user role has been deleted. If your module stores references to roles, it's recommended that you implement this hook and delete existing instances of the deleted role in your module database tables.
$role: The $role object being deleted.
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
function hook_user_role_delete($role) {
// Delete existing instances of the deleted role.
db_delete('my_module_table')
->condition('rid', $role->rid)
->execute();
}