#53 EGifCloseFile() API design flaw

v1.0_(example)
closed
nobody
None
1
2014-05-15
2013-10-27
No

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.)

Discussion

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

     
    • status: open --> accepted
     
    • status: accepted --> closed