Skip to content

Commit

Permalink
fix: remove lvgl event callback on component deletion
Browse files Browse the repository at this point in the history
This cause a segfault
  • Loading branch information
EmixamPP committed Jul 31, 2024
1 parent 179556d commit f86a19a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/render/native/core/basic/comp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,13 @@ void BasicComponent::setBackgroundImage (uint8_t* buf, size_t buf_len, int32_t s
};

BasicComponent::~BasicComponent () {
removeEventListener(0);

comp_map.erase(this->uid);

const lv_coord_t* ptr1 = this->grid_row_desc;
const lv_coord_t* ptr2 = this->grid_column_desc;

for(auto& desc : this->image_desc_map) {
if (desc.second != nullptr) {
const uint8_t* buf = (static_cast<lv_img_dsc_t_1*>(desc.second))->data;
Expand Down

0 comments on commit f86a19a

Please sign in to comment.