From 6f3215166b78cbccd719a769fc8aa4b2c2b4aff2 Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Wed, 28 Aug 2024 20:58:26 +0200 Subject: [PATCH] b UI fix from json not setting function ptr to null --- src/UI/UI_button.cpp | 3 ++- src/UI/UI_slider.cpp | 3 ++- src/UI/UI_textbox.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/UI/UI_button.cpp b/src/UI/UI_button.cpp index 70a8d81..168bde9 100644 --- a/src/UI/UI_button.cpp +++ b/src/UI/UI_button.cpp @@ -7,7 +7,8 @@ UI_button::UI_button(std::string id, std::string text, Color fg_color, Color bg_ } UI_button::UI_button(const json& j) - : UI_item(UI_BUTTON_TYPE) + : UI_item(UI_BUTTON_TYPE), + m_on_click(nullptr) { from_json(j); } diff --git a/src/UI/UI_slider.cpp b/src/UI/UI_slider.cpp index 5178301..fb748e7 100644 --- a/src/UI/UI_slider.cpp +++ b/src/UI/UI_slider.cpp @@ -7,7 +7,8 @@ UI_slider::UI_slider(std::string id, std::string text, Color fg_color, Color bg_ } UI_slider::UI_slider(const json& j) -: UI_item(UI_SLIDER_TYPE) +: UI_item(UI_SLIDER_TYPE), +m_on_change(nullptr) { from_json(j); } diff --git a/src/UI/UI_textbox.cpp b/src/UI/UI_textbox.cpp index 2285117..c981dc7 100644 --- a/src/UI/UI_textbox.cpp +++ b/src/UI/UI_textbox.cpp @@ -6,7 +6,8 @@ UI_textbox::UI_textbox(std::string id, std::string hint, Color fg_color, Color b } UI_textbox::UI_textbox(const json& j) - : UI_item(UI_TEXTBOX_TYPE) + : UI_item(UI_TEXTBOX_TYPE), + m_on_change(nullptr) { from_json(j); }