#53 EGifCloseFile() API design flaw


According to the docs:

Returns GIF_ERROR if something went wrong, GIF_OK otherwise.When GIF_ERROR is returned, the GifFile structure is not freed so that the diagnostic error code will remain accessible in GifFile->Error.

This behavior is a problem, because it's not always possible to free the struct afterwards. Case in point is a C# wrapper for giflib (or any language/environment where you can't just free objects allocated in a foreign shared library.) If EGifCloseFile() returns GIF_ERROR, there's no way to free the structure.

I think a better behavior would be for EGifCloseFile() to free the structure and return the actual error code (if there was one.)


  • Eric S. Raymond

    Eric S. Raymond - 2014-05-14

    Thanks, I've changed the API to address this.

  • Eric S. Raymond

    Eric S. Raymond - 2014-05-14
    • status: open --> accepted
  • Eric S. Raymond

    Eric S. Raymond - 2014-05-15
    • status: accepted --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks