Fix segfault on startup error on Android
authorrubenwardy <rubenwardy@gmail.com>
Sun, 11 Dec 2016 22:17:32 +0000 (22:17 +0000)
committerrubenwardy <rubenwardy@gmail.com>
Mon, 12 Dec 2016 13:22:26 +0000 (13:22 +0000)
src/touchscreengui.cpp
src/touchscreengui.h

index e3c6a39a98ba647b3048fb3fd5096d57ecb5f4cd..8d210c63a843dcd4a77e64de89b009ed21ce1a05 100644 (file)
@@ -177,8 +177,10 @@ void AutoHideButtonBar::init(ISimpleTextureSource* tsrc,
 
 AutoHideButtonBar::~AutoHideButtonBar()
 {
-       m_starter.guibutton->setVisible(false);
-       m_starter.guibutton->drop();
+       if (m_starter.guibutton) {
+               m_starter.guibutton->setVisible(false);
+               m_starter.guibutton->drop();
+       }
 }
 
 void AutoHideButtonBar::addButton(touch_gui_button_id button_id,
index b4de1b03250ded5564d8c95f15daee4bc7cca1a6..53fc6d683b44f44599844f07ef7b268396a8d60d 100644 (file)
@@ -75,7 +75,7 @@ struct button_info {
        float            repeatdelay;
        irr::EKEY_CODE   keycode;
        std::vector<int> ids;
-       IGUIButton*      guibutton;
+       IGUIButton*      guibutton = NULL;
        bool             immediate_release;
 };