- Fix crash when trying to load an already opened project while opening multiple projects.

This commit is contained in:
Tanasart 2024-06-17 12:35:52 +07:00
parent 94330dd272
commit 18dc64fbfd

View File

@ -22,8 +22,12 @@ function TEST_PATH(path) { #region
} #endregion
function LOAD_PATH(path, readonly = false, safe_mode = false) { #region
for( var i = 0, n = array_length(PROJECTS); i < n; i++ )
if(PROJECTS[i].path == path) closeProject(PROJECTS[i]);
for( var i = array_length(PROJECTS) - 1; i >= 0; i-- ) {
var _p = array_safe_get_fast(PROJECTS, i);
if(!is_instanceof(_p, Project)) continue;
if(_p.path == path) closeProject(_p);
}
var _PROJECT = PROJECT;
PROJECT = new Project();