diff --git a/src/Event.cpp b/src/Event.cpp index 1af04cf..5c8bf06 100644 --- a/src/Event.cpp +++ b/src/Event.cpp @@ -3,20 +3,22 @@ Event::Event(){} Event::~Event(){} void Event::add(Input* input, TypedInputHandler handler){ - int pos = position(handler); + int pos = position(input, handler); if(pos != -1) return; typedInputs.push(input); typedInputHandlers.push(handler); } -void Event::remove(TypedInputHandler handler){ - int pos = position(handler); +void Event::remove(Input* input, TypedInputHandler handler){ + int pos = position(input, handler); if(pos == -1) return; typedInputs.erase(pos); typedInputHandlers.erase(pos); } -int Event::position(TypedInputHandler handler){ +int Event::position(Input* input, TypedInputHandler handler){ for(int i=0; ievent.remove(&Input::onOutputChange); + output->event.remove(this, &Input::onOutputChange); output = NULL; } }