code: def destroy(self):
          
          dialog = self.dialog
          if dialog:
              #: Clear the dismiss listener
              #: (or we get an error during the callback)
              dialog.setOnDismissListener(None)
              dialog.dismiss()
              del self.dialog
          super(AndroidDialog, self).destroy()
docs: A reimplemented destructor that cancels 
          the dialog before destroying.