code: function (automatic) {
          var self = this, form;
  
          // One time is enough
          if (self.destroyed) {
            return;
          }
  
          // If user manually calls destroy and not remove
          // Users seems to have logic that calls destroy instead of remove
          if (!automatic && !self.removed) {
            self.remove();
            return;
          }
  
          if (!automatic) {
            self.editorManager.off('beforeunload', self._beforeUnload);
  
            // Manual destroy
            if (self.theme && self.theme.destroy) {
              self.theme.destroy();
            }
  
            // Destroy controls, selection and dom
            self.selection.destroy();
            self.dom.destroy();
          }
  
          form = self.formElement;
          if (form) {
            if (form._mceOldSubmit) {
              form.submit = form._mceOldSubmit;
              form._mceOldSubmit = null;
            }
  
            DOM.unbind(form, 'submit reset', self.formEventDelegate);
          }
  
          self.contentAreaContainer = self.formElement = self.container = self.editorContainer = null;
          self.bodyElement = self.contentDocument = self.contentWindow = null;
          self.iframeElement = self.targetElm = null;
  
          if (self.selection) {
            self.selection = self.selection.win = self.selection.dom = self.selection.dom.doc = null;
          }
  
          self.destroyed = 1;
        }
docs: Destroys the editor instance by removing all events, element references or other resources
  that could leak memory. This method will be called automatically when the page is unloaded
  but you can also call it directly if you know what you are doing.
  
  @method destroy
  @param {Boolean} automatic Optional state if the destroy is an automatic destroy or user called one.