aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/Slot.hh
diff options
context:
space:
mode:
authorHenrik Kinnunen <fluxgen at fluxbox dot org>2011-02-20 14:48:42 (GMT)
committerHenrik Kinnunen <fluxgen at fluxbox dot org>2011-02-20 14:48:42 (GMT)
commit34bf3b4833bcded73646ee5c702dfae52fb8f86b (patch)
tree12d01fc68e94a32d07b0b6b94c9b608155283fb6 /src/FbTk/Slot.hh
parent05e64be3bd876b0f31ba79112219458a00551d39 (diff)
downloadfluxbox_pavel-34bf3b4833bcded73646ee5c702dfae52fb8f86b.zip
fluxbox_pavel-34bf3b4833bcded73646ee5c702dfae52fb8f86b.tar.bz2
Fixed a possible crash when using a slot m_holder = 0
Diffstat (limited to 'src/FbTk/Slot.hh')
-rw-r--r--src/FbTk/Slot.hh14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/FbTk/Slot.hh b/src/FbTk/Slot.hh
index ba3cfc4..9080d53 100644
--- a/src/FbTk/Slot.hh
+++ b/src/FbTk/Slot.hh
@@ -229,7 +229,8 @@ public:
229 } 229 }
230 230
231 void operator()() { 231 void operator()() {
232 reinterpret_cast<CallbackType>(m_holder->m_callback)( m_holder ); 232 if (m_holder)
233 reinterpret_cast<CallbackType>(m_holder->m_callback)( m_holder );
233 } 234 }
234}; 235};
235 236
@@ -247,7 +248,8 @@ public:
247 } 248 }
248 249
249 void operator()(Arg1 arg) { 250 void operator()(Arg1 arg) {
250 reinterpret_cast<CallbackType>(m_holder->m_callback)(m_holder, arg); 251 if (m_holder)
252 reinterpret_cast<CallbackType>(m_holder->m_callback)(m_holder, arg);
251 } 253 }
252 254
253}; 255};
@@ -265,7 +267,8 @@ public:
265 } 267 }
266 268
267 void operator()(Arg1 arg1, Arg2 arg2) { 269 void operator()(Arg1 arg1, Arg2 arg2) {
268 reinterpret_cast<CallbackType>(m_holder->m_callback)(m_holder, arg1, arg2); 270 if (m_holder)
271 reinterpret_cast<CallbackType>(m_holder->m_callback)(m_holder, arg1, arg2);
269 } 272 }
270}; 273};
271 274
@@ -282,8 +285,9 @@ public:
282 } 285 }
283 286
284 void operator()(Arg1 arg1, Arg2 arg2, Arg3 arg3) { 287 void operator()(Arg1 arg1, Arg2 arg2, Arg3 arg3) {
285 reinterpret_cast<CallbackType>(m_holder->m_callback) 288 if (m_holder)
286 ( m_holder, arg1, arg2, arg3 ); 289 reinterpret_cast<CallbackType>(m_holder->m_callback)
290 ( m_holder, arg1, arg2, arg3 );
287 } 291 }
288}; 292};
289 293