From 883d9628384a30fc317e19cb3c3946b4f98b62fe Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Fri, 4 Sep 2020 15:10:12 -0700 Subject: [PATCH] [wpiutil] SimpleBufferPool: Deallocate on destruction --- wpiutil/src/main/native/include/wpi/uv/Buffer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wpiutil/src/main/native/include/wpi/uv/Buffer.h b/wpiutil/src/main/native/include/wpi/uv/Buffer.h index 51acd76bb6..04e96b9035 100644 --- a/wpiutil/src/main/native/include/wpi/uv/Buffer.h +++ b/wpiutil/src/main/native/include/wpi/uv/Buffer.h @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */ +/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -107,6 +107,7 @@ class SimpleBufferPool { * @param size Size of each buffer to allocate. */ explicit SimpleBufferPool(size_t size = 4096) : m_size{size} {} + ~SimpleBufferPool() { Clear(); } SimpleBufferPool(const SimpleBufferPool& other) = delete; SimpleBufferPool& operator=(const SimpleBufferPool& other) = delete;