Why can't I copy an object with LVGL 8.3?

Hello,

I’m having trouble copying an object in LVGL 8.3. In my project, I have an object lv_obj_t* snapshot_obj that I want to copy in order to manipulate its properties (size, position, etc.) without affecting the original object.

Here’s a simplified version of what I’m trying to do:

The code block(s) should be formatted like:

    // Créer un conteneur pour le graphique
    lv_obj_t* container = lv_obj_create(lv_scr_act());
    lv_obj_set_size(container, lv_pct(50), lv_pct(100));  // Taille fixe du conteneur
    lv_obj_clear_flag(container, LV_OBJ_FLAG_CLICKABLE);  // Rendre le conteneur non cliquable
    lv_obj_add_flag(container, LV_OBJ_FLAG_HIDDEN);  // Rendre le conteneur invisible

    lv_chart_set_type(container, lv_chart_get_type(snapshot_obj));
    lv_obj_set_user_data(container, snapshot_obj->user_data);
    // Prendre le snapshot
    lv_img_dsc_t * img_dsc = lv_snapshot_take(snapshot_obj, LV_IMG_CF_TRUE_COLOR_ALPHA);

Description

LVGL 8.3

copy an object

Segmentation fault

Screenshot


image