Fixed a possible crash when using a slot m_holder = 0
Henrik Kinnunen fluxgen at fluxbox dot org
1 files changed,
9 insertions(+),
5 deletions(-)
jump to
M
src/FbTk/Slot.hh
→
src/FbTk/Slot.hh
@@ -229,7 +229,8 @@ (functor, Callback0<Functor, ReturnType>::functionAddress())) {
} void operator()() { - reinterpret_cast<CallbackType>(m_holder->m_callback)( m_holder ); + if (m_holder) + reinterpret_cast<CallbackType>(m_holder->m_callback)( m_holder ); } };@@ -247,7 +248,8 @@
} void operator()(Arg1 arg) { - reinterpret_cast<CallbackType>(m_holder->m_callback)(m_holder, arg); + if (m_holder) + reinterpret_cast<CallbackType>(m_holder->m_callback)(m_holder, arg); } };@@ -265,7 +267,8 @@
} void operator()(Arg1 arg1, Arg2 arg2) { - reinterpret_cast<CallbackType>(m_holder->m_callback)(m_holder, arg1, arg2); + if (m_holder) + reinterpret_cast<CallbackType>(m_holder->m_callback)(m_holder, arg1, arg2); } };@@ -282,8 +285,9 @@
} void operator()(Arg1 arg1, Arg2 arg2, Arg3 arg3) { - reinterpret_cast<CallbackType>(m_holder->m_callback) - ( m_holder, arg1, arg2, arg3 ); + if (m_holder) + reinterpret_cast<CallbackType>(m_holder->m_callback) + ( m_holder, arg1, arg2, arg3 ); } };