mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-15 10:48:33 +01:00
Fix a possible crash when an album cover search times out at the same time that it's cancelled or finishes normally. Fixes issue 2752
This commit is contained in:
parent
23724b667f
commit
63f13b19f2
@ -108,12 +108,18 @@ void AlbumCoverFetcher::StartRequests() {
|
|||||||
|
|
||||||
void AlbumCoverFetcher::SingleSearchFinished(quint64 request_id, CoverSearchResults results) {
|
void AlbumCoverFetcher::SingleSearchFinished(quint64 request_id, CoverSearchResults results) {
|
||||||
AlbumCoverFetcherSearch* search = active_requests_.take(request_id);
|
AlbumCoverFetcherSearch* search = active_requests_.take(request_id);
|
||||||
|
if (!search)
|
||||||
|
return;
|
||||||
|
|
||||||
search->deleteLater();
|
search->deleteLater();
|
||||||
emit SearchFinished(request_id, results, search->statistics());
|
emit SearchFinished(request_id, results, search->statistics());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlbumCoverFetcher::SingleCoverFetched(quint64 request_id, const QImage& image) {
|
void AlbumCoverFetcher::SingleCoverFetched(quint64 request_id, const QImage& image) {
|
||||||
AlbumCoverFetcherSearch* search = active_requests_.take(request_id);
|
AlbumCoverFetcherSearch* search = active_requests_.take(request_id);
|
||||||
|
if (!search)
|
||||||
|
return;
|
||||||
|
|
||||||
search->deleteLater();
|
search->deleteLater();
|
||||||
emit AlbumCoverFetched(request_id, image, search->statistics());
|
emit AlbumCoverFetched(request_id, image, search->statistics());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user