FastLED 3.9.15
Loading...
Searching...
No Matches

◆ nsgif_destroy()

void fl::third_party::nsgif_destroy ( nsgif_t * gif)

Free a NSGIF object.

Parameters
[in]gifThe NSGIF to free.

Definition at line 1395 of file gif.cpp.hpp.

1396{
1397 if (gif == nullptr) {
1398 return;
1399 }
1400
1401 /* Release all our memory blocks */
1402 if (gif->frame_image) {
1403 FL_ASSERT(gif->bitmap.destroy, "GIF bitmap destroy function required");
1404 gif->bitmap.destroy(gif->frame_image);
1405 gif->frame_image = nullptr;
1406 }
1407
1408 fl::Free(gif->frames);
1409 gif->frames = nullptr;
1410
1411 fl::Free(gif->prev_frame);
1412 gif->prev_frame = nullptr;
1413
1414 lzw_context_destroy(static_cast<struct lzw_ctx*>(gif->lzw_ctx));
1415 gif->lzw_ctx = nullptr;
1416
1417 fl::Free(gif);
1418}
#define FL_ASSERT(x, MSG)
Definition assert.h:6
void lzw_context_destroy(struct lzw_ctx *ctx) FL_NOEXCEPT
Destroy an LZW decompression context.
Definition lzw.cpp.hpp:116
nsgif_bitmap_t * frame_image
currently decoded image; stored as bitmap from bitmap_create callback
Definition gif.cpp.hpp:86
nsgif_frame * frames
decoded frames
Definition gif.cpp.hpp:79
nsgif_bitmap_cb_vt bitmap
callbacks for bitmap functions
Definition gif.cpp.hpp:77
void(* destroy)(nsgif_bitmap_t *bitmap)
Callback to free a bitmap.
Definition nsgif.hpp:193
void * lzw_ctx
LZW decode context.
Definition gif.cpp.hpp:75
void * prev_frame
previous frame for NSGIF_FRAME_RESTORE
Definition gif.cpp.hpp:134
void Free(void *ptr)

References FL_ASSERT, FL_NOEXCEPT, fl::Free(), and lzw_context_destroy().

Referenced by fl::third_party::SoftwareGifDecoder::cleanupDecoder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: