LVGL GIF Creation and Deletion

Hi Team,

I am using below source as a reference for running GIF using LVGL (Using v7).

Creating and deleting of the GIF has done as below.

GIF Creation
guider_ui->screen_StraightAhead = lv_gif_create_from_data(guider_ui->screen, straight_gif_map);
lv_obj_set_pos(guider_ui->screen_StraightAhead, 117, 58);
lv_obj_set_size(guider_ui->screen_StraightAhead, 56, 50);

GIF Deletion
if (guider_ui->screen_StraightAhead != NULL)

Could you please suggest me whether above approach for GIF Create & Delete is fine or something else is required for it?

Prashanth Kumar K