Commit dbee4ba3 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

This should fix the crash in logging service in c++ wrapper

parent a4ffc297
......@@ -34,10 +34,12 @@ using namespace {{{namespace}}};
static {{{returnType}}} {{{cbName}}}({{{declArgs}}}) {
{{#ismultilistenable}}
{{{cListenerName}}} *cbs = {{{currentCallbacksGetter}}}({{{firstArgName}}});
std::list<std::shared_ptr<Listener> > listeners = *(std::list<std::shared_ptr<Listener> > *){{{userDataGetter}}}(cbs);
for(auto it=listeners.begin(); it!=listeners.end(); it++) {
std::shared_ptr<{{{cppListenerName}}}> listener = std::static_pointer_cast<{{{cppListenerName}}},Listener>(*it);
{{{cppMethodCallingLine}}};
if (cbs) {
std::list<std::shared_ptr<Listener> > listeners = *(std::list<std::shared_ptr<Listener> > *){{{userDataGetter}}}(cbs);
for(auto it=listeners.begin(); it!=listeners.end(); it++) {
std::shared_ptr<{{{cppListenerName}}}> listener = std::static_pointer_cast<{{{cppListenerName}}},Listener>(*it);
{{{cppMethodCallingLine}}};
}
}
{{/ismultilistenable}}
{{#ismonolistenable}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment