summaryrefslogtreecommitdiff
path: root/core/io/xml_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/xml_parser.cpp')
-rw-r--r--core/io/xml_parser.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp
index 360da46f96..7b43193f47 100644
--- a/core/io/xml_parser.cpp
+++ b/core/io/xml_parser.cpp
@@ -472,7 +472,7 @@ Error XMLParser::open_buffer(const Vector<uint8_t> &p_buffer) {
Error XMLParser::open(const String &p_path) {
Error err;
- FileAccess *file = FileAccess::open(p_path, FileAccess::READ, &err);
+ Ref<FileAccess> file = FileAccess::open(p_path, FileAccess::READ, &err);
ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot open file '" + p_path + "'.");
@@ -488,8 +488,6 @@ Error XMLParser::open(const String &p_path) {
data[length] = 0;
P = data;
- memdelete(file);
-
return OK;
}