chunks: declare DiscoverVersion destructor virtual
The concrete subclasses are deleted polymorphically through a unique_ptr<DiscoverVersion>. Also add -Wnon-virtual-dtor to the default CXXFLAGS to prevent this from happening in the future. Change-Id: If00a99566a54c7af4cd27df6fe68dcdef4cb4e82
This commit is contained in:
1 parent
7072e1604a
commit
887336ca8d
3 files changed
+16
-10
No files matched your search
@@ -132,6 +132,7 @@ class GccBasicFlags(CompilerFlags):
|
||||
'-Wall',
|
||||
'-Wextra',
|
||||
'-Werror',
|
||||
'-Wnon-virtual-dtor',
|
||||
'-Wno-error=deprecated-declarations', # Bug #3795
|
||||
'-Wno-error=maybe-uninitialized', # Bug #1615
|
||||
'-Wno-unused-parameter',
|
||||
@@ -146,6 +147,7 @@ class GccBasicFlags(CompilerFlags):
|
||||
'-pedantic',
|
||||
'-Wall',
|
||||
'-Wextra',
|
||||
'-Wnon-virtual-dtor',
|
||||
'-Wno-unused-parameter',
|
||||
]
|
||||
flags['LINKFLAGS'] += ['-fuse-ld=gold', '-Wl,-O1']
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/**
|
||||
* Copyright (c) 2016, Regents of the University of California,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University.
|
||||
/*
|
||||
* Copyright (c) 2016-2017, Regents of the University of California,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
@@ -38,9 +38,10 @@ DiscoverVersion::DiscoverVersion(const Name& prefix, Face& face, const Options&
|
||||
{
|
||||
}
|
||||
|
||||
DiscoverVersion::~DiscoverVersion() = default;
|
||||
|
||||
void
|
||||
DiscoverVersion::expressInterest(const Interest& interest, int maxRetriesNack,
|
||||
int maxRetriesTimeout)
|
||||
DiscoverVersion::expressInterest(const Interest& interest, int maxRetriesNack, int maxRetriesTimeout)
|
||||
{
|
||||
fetcher = DataFetcher::fetch(m_face, interest, maxRetriesNack, maxRetriesTimeout,
|
||||
bind(&DiscoverVersion::handleData, this, _1, _2),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/**
|
||||
* Copyright (c) 2016, Regents of the University of California,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University.
|
||||
/*
|
||||
* Copyright (c) 2016-2017, Regents of the University of California,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University.
|
||||
*
|
||||
* This file is part of ndn-tools (Named Data Networking Essential Tools).
|
||||
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
|
||||
@@ -64,6 +64,9 @@ public:
|
||||
*/
|
||||
DiscoverVersion(const Name& prefix, Face& face, const Options& options);
|
||||
|
||||
virtual
|
||||
~DiscoverVersion();
|
||||
|
||||
/**
|
||||
* @brief identify the latest Data version published.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user