You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-26 15:46:23 +00:00
Fix crash when exporting projects with shared libraries
(cherry picked from commit 680bcef825)
This commit is contained in:
committed by
Rémi Verschelde
parent
113102aa51
commit
50ba2d3051
@@ -145,6 +145,10 @@ struct DirAccessRef {
|
|||||||
operator bool() const { return f != nullptr; }
|
operator bool() const { return f != nullptr; }
|
||||||
DirAccess *f;
|
DirAccess *f;
|
||||||
DirAccessRef(DirAccess *fa) { f = fa; }
|
DirAccessRef(DirAccess *fa) { f = fa; }
|
||||||
|
DirAccessRef(DirAccessRef &&other) {
|
||||||
|
f = other.f;
|
||||||
|
other.f = nullptr;
|
||||||
|
}
|
||||||
~DirAccessRef() {
|
~DirAccessRef() {
|
||||||
if (f) {
|
if (f) {
|
||||||
memdelete(f);
|
memdelete(f);
|
||||||
|
|||||||
@@ -186,6 +186,10 @@ struct FileAccessRef {
|
|||||||
FileAccess *f;
|
FileAccess *f;
|
||||||
operator FileAccess *() { return f; }
|
operator FileAccess *() { return f; }
|
||||||
FileAccessRef(FileAccess *fa) { f = fa; }
|
FileAccessRef(FileAccess *fa) { f = fa; }
|
||||||
|
FileAccessRef(FileAccessRef &&other) {
|
||||||
|
f = other.f;
|
||||||
|
other.f = nullptr;
|
||||||
|
}
|
||||||
~FileAccessRef() {
|
~FileAccessRef() {
|
||||||
if (f) {
|
if (f) {
|
||||||
memdelete(f);
|
memdelete(f);
|
||||||
|
|||||||
@@ -1682,8 +1682,7 @@ Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_pr
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (err == OK && !so_files.empty()) {
|
if (err == OK && !so_files.empty()) {
|
||||||
//if shared object files, copy them
|
// If shared object files, copy them.
|
||||||
da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
|
||||||
for (int i = 0; i < so_files.size() && err == OK; i++) {
|
for (int i = 0; i < so_files.size() && err == OK; i++) {
|
||||||
err = da->copy(so_files[i].path, p_path.get_base_dir().plus_file(so_files[i].path.get_file()));
|
err = da->copy(so_files[i].path, p_path.get_base_dir().plus_file(so_files[i].path.get_file()));
|
||||||
if (err == OK) {
|
if (err == OK) {
|
||||||
|
|||||||
Reference in New Issue
Block a user