summaryrefslogtreecommitdiff
path: root/libc/src/stdio/fopencookie.cpp
diff options
context:
space:
mode:
authorSiva Chandra Reddy <sivachandra@google.com>2022-12-22 08:13:19 +0000
committerSiva Chandra Reddy <sivachandra@google.com>2022-12-22 22:31:06 +0000
commitf9868aa7292a0821f4ed29048d4d4214b17cbb92 (patch)
treeb78b86b77ec8071cf851300ad7db65b301df5388 /libc/src/stdio/fopencookie.cpp
parentb27e0b2e6703710c140aefd2990091f1779841ac (diff)
downloadllvm-f9868aa7292a0821f4ed29048d4d4214b17cbb92.tar.gz
[libc][NFC] Use operator delete to cleanup a File object.
The File API has been refactored to allow cleanup using operator delete. Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D140574
Diffstat (limited to 'libc/src/stdio/fopencookie.cpp')
-rw-r--r--libc/src/stdio/fopencookie.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libc/src/stdio/fopencookie.cpp b/libc/src/stdio/fopencookie.cpp
index a48e28f1324e..2e3cce7e6672 100644
--- a/libc/src/stdio/fopencookie.cpp
+++ b/libc/src/stdio/fopencookie.cpp
@@ -32,8 +32,9 @@ public:
CookieFile(void *c, cookie_io_functions_t cops, uint8_t *buffer,
size_t bufsize, File::ModeFlags mode)
: File(&cookie_write, &cookie_read, &CookieFile::cookie_seek,
- &cookie_close, &cookie_flush, buffer, bufsize,
- 0 /* default buffering mode */, true /* File owns buffer */, mode),
+ &cookie_close, &cookie_flush, &cleanup_file<CookieFile>, buffer,
+ bufsize, 0 /* default buffering mode */,
+ true /* File owns buffer */, mode),
cookie(c), ops(cops) {}
};