fix(events): Fix crash in getStdFunctionAddress (#10321)
This commit is contained in:
parent
4e9eb35752
commit
eda6d21d87
1 changed files with 4 additions and 1 deletions
|
|
@ -228,7 +228,10 @@ void NetworkEvents::removeEvent(NetworkEventCb cbEvent, arduino_event_id_t event
|
||||||
template<typename T, typename... U> static size_t getStdFunctionAddress(std::function<T(U...)> f) {
|
template<typename T, typename... U> static size_t getStdFunctionAddress(std::function<T(U...)> f) {
|
||||||
typedef T(fnType)(U...);
|
typedef T(fnType)(U...);
|
||||||
fnType **fnPointer = f.template target<fnType *>();
|
fnType **fnPointer = f.template target<fnType *>();
|
||||||
|
if (fnPointer != nullptr) {
|
||||||
return (size_t)*fnPointer;
|
return (size_t)*fnPointer;
|
||||||
|
}
|
||||||
|
return (size_t)fnPointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkEvents::removeEvent(NetworkEventFuncCb cbEvent, arduino_event_id_t event) {
|
void NetworkEvents::removeEvent(NetworkEventFuncCb cbEvent, arduino_event_id_t event) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue