Skip to content

Commit f86a19a

Browse files
committed
fix: remove lvgl event callback on component deletion
This cause a segfault
1 parent 179556d commit f86a19a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/render/native/core/basic/comp.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,13 @@ void BasicComponent::setBackgroundImage (uint8_t* buf, size_t buf_len, int32_t s
234234
};
235235

236236
BasicComponent::~BasicComponent () {
237+
removeEventListener(0);
238+
237239
comp_map.erase(this->uid);
238240

239241
const lv_coord_t* ptr1 = this->grid_row_desc;
240242
const lv_coord_t* ptr2 = this->grid_column_desc;
241-
243+
242244
for(auto& desc : this->image_desc_map) {
243245
if (desc.second != nullptr) {
244246
const uint8_t* buf = (static_cast<lv_img_dsc_t_1*>(desc.second))->data;

0 commit comments

Comments
 (0)