Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

use scope guard instead of fclose myself

  • Loading branch information...
commit bc54aa1e55b0075e2352dcddfaeb880c17d2591b 1 parent a55f8d5
@pkrumins pkrumins authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/async_animated_gif.cpp
2  src/async_animated_gif.cpp
@@ -80,6 +80,7 @@ AsyncAnimatedGif::EIO_Push(eio_req *req)
push_req->tmp_dir, push_req->push_id, push_req->fragment_id,
push_req->x, push_req->y, push_req->w, push_req->h);
FILE *out = fopen(filename, "w+");
+ LOKI_ON_BLOCK_EXIT(fclose, out);
if (!out) {
fprintf(stderr, "Failed to open %s in AsyncAnimatedGif::EIO_Push.\n",
filename); // can't get errno either cause this stuff is async
@@ -90,7 +91,6 @@ AsyncAnimatedGif::EIO_Push(eio_req *req)
fprintf(stderr, "Failed to write all data to %s. Wrote only %d of %d.\n",
filename, written, push_req->data_size);
- fclose(out);
return 0;
Please sign in to comment.
Something went wrong with that request. Please try again.