code: public void deleteDescriptorIfNecessary() throws CmsException {
  
          if (m_removeDescriptorOnCancel && (m_desc != null)) {
              m_cms.deleteResource(m_desc, CmsResourceDeleteMode.valueOf(2));
          }
  
      }
docs: When the descriptor was added while editing, but the change was not saved, it has to be removed
  when the editor is closed.
  @throws CmsException thrown when deleting the descriptor resource fails