code: def write_extent(self):
          
          self.extent_dialog.accept()
          self.extent_dialog.clear_extent.disconnect(
              self.parent.dock.extent.clear_user_analysis_extent)
          self.extent_dialog.extent_defined.disconnect(
              self.parent.dock.define_user_analysis_extent)
          self.extent_dialog.capture_button.clicked.disconnect(
              self.start_capture_coordinates)
          self.extent_dialog.tool.rectangle_created.disconnect(
              self.stop_capture_coordinates)
docs: After the extent selection, save the extent and disconnect signals.