summaryrefslogtreecommitdiffstats
path: root/platform/uwp/export/export_plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/uwp/export/export_plugin.h')
-rw-r--r--platform/uwp/export/export_plugin.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/platform/uwp/export/export_plugin.h b/platform/uwp/export/export_plugin.h
index bf89b10ffa..7f10b00dc1 100644
--- a/platform/uwp/export/export_plugin.h
+++ b/platform/uwp/export/export_plugin.h
@@ -346,7 +346,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
ERR_FAIL_V_MSG(data, err_string);
}
- FileAccess *f = FileAccess::open(tmp_path, FileAccess::READ, &err);
+ Ref<FileAccess> f = FileAccess::open(tmp_path, FileAccess::READ, &err);
if (err != OK) {
String err_string = "Couldn't open temp logo file.";
@@ -359,8 +359,6 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
data.resize(f->get_length());
f->get_buffer(data.ptrw(), data.size());
- f->close();
- memdelete(f);
DirAccess::remove_file_or_error(tmp_path);
return data;
@@ -417,7 +415,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform {
}
static Error save_appx_file(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total, const Vector<String> &p_enc_in_filters, const Vector<String> &p_enc_ex_filters, const Vector<uint8_t> &p_key) {
- AppxPackager *packager = (AppxPackager *)p_userdata;
+ AppxPackager *packager = static_cast<AppxPackager *>(p_userdata);
String dst_path = p_path.replace_first("res://", "game/");
return packager->add_file(dst_path, p_data.ptr(), p_data.size(), p_file, p_total, _should_compress_asset(p_path, p_data));