From f1254d54c36cb7960fe7f134d41599b7a96619b5 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 4 Jan 2023 14:38:17 -0500 Subject: [PATCH] Minor memory leak fix --- include/blt/std/random.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/blt/std/random.h b/include/blt/std/random.h index 27900f7..7723483 100644 --- a/include/blt/std/random.h +++ b/include/blt/std/random.h @@ -26,7 +26,10 @@ namespace BLT { distribution = new dist(min, max); } T get(){ - return *distribution(gen); + return (*distribution)(gen); + } + ~Random(){ + delete distribution; } }; }