diff --git a/wrappers/cpp/class_impl.mustache b/wrappers/cpp/class_impl.mustache index 8e7d9ba13..26615b5ed 100644 --- a/wrappers/cpp/class_impl.mustache +++ b/wrappers/cpp/class_impl.mustache @@ -74,8 +74,8 @@ void {{{className}}}::removeListener(const std::shared_ptr<{{{listenerClassName} {{#isfactory}} std::shared_ptr Factory::createCore(const std::shared_ptr & listener, const std::string & configPath, const std::string & factoryConfigPath) const { ::LinphoneCoreCbs *cbs = NULL; + std::list > listeners; if (listener != nullptr) { - std::list > listeners; listeners.push_back(std::static_pointer_cast(listener)); cbs = Core::createCallbacks(&listeners); } @@ -95,8 +95,8 @@ std::shared_ptr Factory::createCore(const std::shared_ptr & std::shared_ptr Factory::createCoreWithConfig(const std::shared_ptr & listener, const std::shared_ptr & config) const { ::LinphoneCoreCbs *cbs = NULL; + std::list > listeners; if (listener != nullptr) { - std::list > listeners; listeners.push_back(std::static_pointer_cast(listener)); cbs = Core::createCallbacks(&listeners); }