fix(mixers): cleanup callback on parent before being destroyed
This commit is contained in:
committed by
Raphael Coeffic
parent
431b423d63
commit
f033895b52
@@ -175,6 +175,7 @@ class MixLineButton : public InputMixButton
|
|||||||
public:
|
public:
|
||||||
MixLineButton(Window* parent, uint8_t index);
|
MixLineButton(Window* parent, uint8_t index);
|
||||||
void paint(BitmapBuffer* dc) override;
|
void paint(BitmapBuffer* dc) override;
|
||||||
|
void deleteLater(bool detach = true, bool trash = true) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
size_t getLines() const override;
|
size_t getLines() const override;
|
||||||
@@ -241,6 +242,13 @@ MixLineButton::MixLineButton(Window* parent, uint8_t index) :
|
|||||||
lv_obj_add_event_cb(p_obj, mix_draw_mplex, LV_EVENT_DRAW_PART_END, lvobj);
|
lv_obj_add_event_cb(p_obj, mix_draw_mplex, LV_EVENT_DRAW_PART_END, lvobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MixLineButton::deleteLater(bool detach, bool trash)
|
||||||
|
{
|
||||||
|
lv_obj_t* p_obj = parent->getLvObj();
|
||||||
|
lv_obj_remove_event_cb_with_user_data(p_obj, mix_draw_mplex, lvobj);
|
||||||
|
InputMixButton::deleteLater(detach, trash);
|
||||||
|
}
|
||||||
|
|
||||||
size_t MixLineButton::getLines() const
|
size_t MixLineButton::getLines() const
|
||||||
{
|
{
|
||||||
const MixData* mix = mixAddress(index);
|
const MixData* mix = mixAddress(index);
|
||||||
|
|||||||
Reference in New Issue
Block a user