Use the sotred path when cleanin up temp files.

This commit is contained in:
Relintai 2024-03-10 07:07:38 +01:00
parent 2f950e87d6
commit b96205f05f

View File

@ -152,15 +152,14 @@ HTTPParser::~HTTPParser() {
parser = nullptr; parser = nullptr;
if (_upload_file_access) { if (_upload_file_access) {
String path = _upload_file_access->get_path();
_upload_file_access->close(); _upload_file_access->close();
memdelete(_upload_file_access); memdelete(_upload_file_access);
_upload_file_access = NULL; _upload_file_access = NULL;
DirAccess *d = DirAccess::create_for_path(path.get_base_dir()); DirAccess *d = DirAccess::create_for_path(_upload_file_full_path.get_base_dir());
if (d) { if (d) {
d->remove(path); d->remove(_upload_file_full_path);
memdelete(d); memdelete(d);
} }
} }