aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubenwardy <rubenwardy@gmail.com>2016-12-11 22:17:32 +0000
committerrubenwardy <rubenwardy@gmail.com>2016-12-12 13:22:26 +0000
commit540071002e949dfa7be3999a58be46d75d7631e9 (patch)
tree30ded241c505e45d47e96e0a4a70e94438cfc6d6 /src
parent0fdf24d64ab055a97e488eb3775cc7c721156d3c (diff)
downloadminetest-540071002e949dfa7be3999a58be46d75d7631e9.tar.gz
minetest-540071002e949dfa7be3999a58be46d75d7631e9.tar.bz2
minetest-540071002e949dfa7be3999a58be46d75d7631e9.zip
Fix segfault on startup error on Android
Diffstat (limited to 'src')
-rw-r--r--src/touchscreengui.cpp6
-rw-r--r--src/touchscreengui.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/touchscreengui.cpp b/src/touchscreengui.cpp
index e3c6a39a9..8d210c63a 100644
--- a/src/touchscreengui.cpp
+++ b/src/touchscreengui.cpp
@@ -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,
diff --git a/src/touchscreengui.h b/src/touchscreengui.h
index b4de1b032..53fc6d683 100644
--- a/src/touchscreengui.h
+++ b/src/touchscreengui.h
@@ -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;
};