Your gist says removeListener for this function.