Skip to content

Commit 26b8485

Browse files
Invoke rte_eal_cleanup on application exit (#1848)
Co-authored-by: Liu, An-Chi <phy.tiger@gmail.com>
1 parent d4bfc6a commit 26b8485

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Pcap++/src/DpdkDeviceList.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ namespace pcpp
6565
DpdkDeviceList::~DpdkDeviceList()
6666
{
6767
m_DpdkDeviceListView.clear();
68+
if (m_IsInitialized)
69+
{
70+
int ret = rte_eal_cleanup();
71+
if (ret < 0)
72+
{
73+
PCPP_LOG_ERROR("failed to cleanup the DPDK EAL");
74+
}
75+
}
6876
}
6977

7078
bool DpdkDeviceList::initDpdk(CoreMask coreMask, uint32_t mBufPoolSizePerDevice, uint16_t mBufDataSize,

0 commit comments

Comments
 (0)