From f3e18da4165ad3c9f6207c87d8c6079be3fa5715 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 15 Oct 2024 21:49:42 -0400 Subject: [PATCH] Use custom type for deleter. --- OSBindings/SDL/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OSBindings/SDL/main.cpp b/OSBindings/SDL/main.cpp index 60620adb3..309eb725a 100644 --- a/OSBindings/SDL/main.cpp +++ b/OSBindings/SDL/main.cpp @@ -444,7 +444,12 @@ std::string final_path_component(const std::string &path) { Executes @c command and returns its STDOUT. */ std::string system_get(const char *command) { - std::unique_ptr pipe(popen(command, "r"), pclose); + struct pcloser { + void operator()(FILE *file) { + pclose(dir); + } + }; + std::unique_ptr pipe(popen(command, "r")); if(!pipe) return ""; std::string result;