Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Re #142: Swap out assertions for early return
Browse files Browse the repository at this point in the history
This prevents warnings when we're already checking the values,
presumably because of race conditions.
  • Loading branch information
IBBoard committed Aug 27, 2020
1 parent 0888790 commit 77fb1e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/CbMediaDownloader.c
Expand Up @@ -516,10 +516,12 @@ cb_media_downloader_load_hires_async (CbMediaDownloader *downloader,

g_return_if_fail (CB_IS_MEDIA_DOWNLOADER (downloader));
g_return_if_fail (CB_IS_MEDIA (media));
g_return_if_fail (!media->loaded_hires);
g_return_if_fail (!media->loading_hires);
g_return_if_fail (media->surface_hires == NULL);

if (media->loading_hires || media->loaded_hires) {
return;
}

media->loading_hires = TRUE;
task = g_task_new (downloader, downloader->cancellable, callback, user_data);
data = g_new0 (LoadingData, 1);
Expand Down

0 comments on commit 77fb1e1

Please sign in to comment.