diff --git a/src/onthespot/gui/thumb_listitem.py b/src/onthespot/gui/thumb_listitem.py index eac0fbc..462b4f3 100644 --- a/src/onthespot/gui/thumb_listitem.py +++ b/src/onthespot/gui/thumb_listitem.py @@ -27,7 +27,7 @@ def __init__(self, label, thumb_url): # Create QNetworkAccessManager self.manager = QNetworkAccessManager(self) - request = QNetworkRequest(QUrl(thumb_url)) # Create the network request + request = QNetworkRequest(QUrl(thumb_url)) # Connect the finished signal to the slot self.manager.finished.connect(self.on_finished) @@ -47,9 +47,9 @@ def on_finished(self, reply: QNetworkReply): pixmap = QPixmap() pixmap.loadFromData(image_data) - # Scale the pixmap to fit within the 60x60 size scaled_pixmap = pixmap.scaled(self.aspect_ratio, self.aspect_ratio, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation) self.image_label.setPixmap(scaled_pixmap) # Update the QLabel with the pixmap - # Clean up the reply object + # Mark request for deletion + self.manager.deleteLater() reply.deleteLater() \ No newline at end of file