X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=include%2Fafb%2Fc%2B%2B%2Fbinding-wrap.hpp;h=b798cf11dec157799285c34dace57cd99de6916a;hb=refs%2Ftags%2F12.91.0;hp=a998469057f94271370b95484468392cdef94d7a;hpb=65353dce81a629e042800bb7b86fcd869a76727e;p=src%2Fapp-framework-binder.git diff --git a/include/afb/c++/binding-wrap.hpp b/include/afb/c++/binding-wrap.hpp index a9984690..b798cf11 100644 --- a/include/afb/c++/binding-wrap.hpp +++ b/include/afb/c++/binding-wrap.hpp @@ -21,6 +21,7 @@ #include #include #include +#include /* ensure version */ #ifndef AFB_BINDING_VERSION @@ -299,6 +300,7 @@ public: friend class req; afb_req_t req_; contextclass(afb_req_t r) : req_(r) {} + static void default_destroyer(T*t) { delete t; } public: inline operator T *() const { return get(); } @@ -311,7 +313,7 @@ public: nullptr)); } - inline void set(T *value, void (*destroyer)(T*) = [](T*t){delete t;}) const { + inline void set(T *value, void (*destroyer)(T*) = default_destroyer) const { afb_req_context(req_, 1, nullptr, reinterpret_cast(destroyer), @@ -782,7 +784,7 @@ constexpr afb_verb_t verb( session, auth, glob, - (void*)(&callback) + *(void**)(&callback) ); }