* Fix runtime error: reference binding to null pointer of type Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com> * delete cppcheck v1.89 workaround Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
This commit is contained in:
parent
6756ccfb50
commit
a2004f8369
2 changed files with 2 additions and 7 deletions
|
@ -92,12 +92,7 @@ struct PublisherOptionsWithAllocator : public PublisherOptionsBase
|
||||||
get_allocator() const
|
get_allocator() const
|
||||||
{
|
{
|
||||||
if (!this->allocator) {
|
if (!this->allocator) {
|
||||||
// TODO(wjwwood): I would like to use the commented line instead, but
|
return std::make_shared<Allocator>();
|
||||||
// cppcheck 1.89 fails with:
|
|
||||||
// Syntax Error: AST broken, binary operator '>' doesn't have two operands.
|
|
||||||
// return std::make_shared<Allocator>();
|
|
||||||
std::shared_ptr<Allocator> tmp(new Allocator());
|
|
||||||
return tmp;
|
|
||||||
}
|
}
|
||||||
return this->allocator;
|
return this->allocator;
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ struct SubscriptionOptionsWithAllocator : public SubscriptionOptionsBase
|
||||||
rcl_subscription_options_t result = rcl_subscription_get_default_options();
|
rcl_subscription_options_t result = rcl_subscription_get_default_options();
|
||||||
using AllocatorTraits = std::allocator_traits<Allocator>;
|
using AllocatorTraits = std::allocator_traits<Allocator>;
|
||||||
using MessageAllocatorT = typename AllocatorTraits::template rebind_alloc<MessageT>;
|
using MessageAllocatorT = typename AllocatorTraits::template rebind_alloc<MessageT>;
|
||||||
auto message_alloc = std::make_shared<MessageAllocatorT>(*allocator.get());
|
auto message_alloc = std::make_shared<MessageAllocatorT>(*this->get_allocator().get());
|
||||||
result.allocator = allocator::get_rcl_allocator<MessageT>(*message_alloc);
|
result.allocator = allocator::get_rcl_allocator<MessageT>(*message_alloc);
|
||||||
result.qos = qos.get_rmw_qos_profile();
|
result.qos = qos.get_rmw_qos_profile();
|
||||||
result.rmw_subscription_options.ignore_local_publications = this->ignore_local_publications;
|
result.rmw_subscription_options.ignore_local_publications = this->ignore_local_publications;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue