code: def disconnect_layer_listener(self):
          
          project = QgsProject.instance()
          project.layersWillBeRemoved.disconnect(self.get_layers)
          project.layersAdded.disconnect(self.get_layers)
          project.layersRemoved.disconnect(self.get_layers)
  
          self.iface.mapCanvas().layersChanged.disconnect(self.get_layers)
          self.iface.currentLayerChanged.disconnect(self.layer_changed)
docs: Destroy the signal/slot to listen for layers loaded in QGIS.
  
          ..seealso:: connect_layer_listener