From 78ad8a1646719b5c51fa860ccfb8a71a831af5ae Mon Sep 17 00:00:00 2001 From: Jonathan Protzenko Date: Wed, 16 Sep 2015 12:08:09 -0700 Subject: [PATCH] Small tweak for the new ignore function. --- inc/MicroBitMessageBus.h | 2 +- source/MicroBitMessageBus.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/inc/MicroBitMessageBus.h b/inc/MicroBitMessageBus.h index fdace6a..a31e7fb 100644 --- a/inc/MicroBitMessageBus.h +++ b/inc/MicroBitMessageBus.h @@ -177,7 +177,7 @@ class MicroBitMessageBus : public MicroBitComponent * uBit.MessageBus.ignore(MICROBIT_ID_BUTTON_B, MICROBIT_BUTTON_EVT_CLICK, onButtonBClick); * @endcode */ - void ignore(int id, int value, void (*handler)(MicroBitEvent, void*), void* arg); + void ignore(int id, int value, void (*handler)(MicroBitEvent, void*)); /** * Unregister a listener function. diff --git a/source/MicroBitMessageBus.cpp b/source/MicroBitMessageBus.cpp index 3d7b999..be5c1ff 100644 --- a/source/MicroBitMessageBus.cpp +++ b/source/MicroBitMessageBus.cpp @@ -341,12 +341,13 @@ void MicroBitMessageBus::ignore(int id, int value, void (*handler)(MicroBitEvent * uBit.MessageBus.ignore(MICROBIT_ID_BUTTON_B, MICROBIT_BUTTON_EVT_CLICK, onButtonBClick); * @endcode */ -void MicroBitMessageBus::ignore(int id, int value, void (*handler)(MicroBitEvent, void*), void* arg) +void MicroBitMessageBus::ignore(int id, int value, void (*handler)(MicroBitEvent, void*)) { if (handler == NULL) return; - MicroBitListener listener(id, value, handler, arg); + // The remove function is not comparing the [arg] anyhow. + MicroBitListener listener(id, value, handler, NULL); remove(&listener); }