diff options
| author | Andre Weissflog <floooh@gmail.com> | 2019-07-06 16:16:19 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2019-07-06 16:16:19 +0200 |
| commit | eccf59f5650da59595b002d46d3f896df33df9a3 (patch) | |
| tree | 5a1ee0c3c473fe6f31a02bae1171aa309bfdd13c /sokol_fetch.h | |
| parent | f57fcf6d93633a1ddc4903ebfc159ded3fdd7661 (diff) | |
sokol_fetch.h: more typos
Diffstat (limited to 'sokol_fetch.h')
| -rw-r--r-- | sokol_fetch.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sokol_fetch.h b/sokol_fetch.h index 2941833b..09be5761 100644 --- a/sokol_fetch.h +++ b/sokol_fetch.h @@ -359,10 +359,11 @@ if (response.finished) { // unbind and free the currently associated buffer, // the buffer pointer could be null if the request has failed + // NOTE that it is legal to call free() with a nullptr, + // this happens if the request failed to open its file + // and never goes into the OPENED state void* buf_ptr = sfetch_unbind_buffer(response.handle); - if (buf_ptr) { - free(buf_ptr); - } + free(buf_ptr); } } @@ -387,7 +388,7 @@ ======================================== A request goes through a number of states during its lifetime. Depending on the current state of a request, it will be 'owned' either by the - "user-thread" (where the code was sent), and an IO thread. + "user-thread" (where the code was sent) or an IO thread. You can think of a request as "ping-ponging" between the IO thread and user thread, any actual IO work is done on the IO thread, while |