[Project Loading] Fix freeze when loading project with invalid group.

This commit is contained in:
Tanasart 2024-12-25 11:21:55 +07:00
parent df0fdd38af
commit 5c0eb2c486

View file

@ -41,47 +41,34 @@ switch(load_process) {
printIf(log, $" > Load nodes : {(get_timer() - t1) / 1000} ms"); t1 = get_timer(); printIf(log, $" > Load nodes : {(get_timer() - t1) / 1000} ms"); t1 = get_timer();
load_process = 2; load_process = 2;
load_step = 0; load_step = 0;
// break; break;
// case 2 : case 2 :
ds_queue_clear(CONNECTION_CONFLICT); ds_queue_clear(CONNECTION_CONFLICT);
try { try { array_foreach(create_list, function(n) /*=>*/ {return n.loadGroup()} ); }
array_foreach(create_list, function(node) /*=>*/ {return node.loadGroup()} ); catch(e) { log_warning("LOAD, group", exception_print(e)); }
} catch(e) {
log_warning("LOAD, group", exception_print(e));
return false;
}
printIf(log, $" > Load group : {(get_timer() - t1) / 1000} ms"); t1 = get_timer(); printIf(log, $" > Load group : {(get_timer() - t1) / 1000} ms"); t1 = get_timer();
load_process = 3; load_process = 3;
// break; // break;
// case 3 : // case 3 :
try { try { array_foreach(create_list, function(n) /*=>*/ {return n.postDeserialize()} ); }
array_foreach(create_list, function(node) /*=>*/ {return node.postDeserialize()} ); catch(e) { log_warning("LOAD, deserialize", exception_print(e)); }
} catch(e) {
log_warning("LOAD, deserialize", exception_print(e));
}
printIf(log, $" > Deserialize: {(get_timer() - t1) / 1000} ms"); t1 = get_timer(); printIf(log, $" > Deserialize: {(get_timer() - t1) / 1000} ms"); t1 = get_timer();
load_process = 4; load_process = 4;
// break; // break;
// case 4 : // case 4 :
// var _skp = false; var _skp = false;
// var _t = get_timer(); var _t = get_timer();
try { try {
for(; load_step < node_length; load_step++) { for(; load_step < node_length; load_step++) {
create_list[load_step].applyDeserialize(); create_list[load_step].applyDeserialize();
// if(load_step < node_length - 1 && get_timer() - _t > load_delay) { _skp = true; break; }
// var _ts = get_timer() - _t;
// if(load_step < node_length - 1 && _ts > load_delay) {
// _skp = true;
// break;
// }
} }
} catch(e) { } catch(e) {
@ -99,9 +86,10 @@ switch(load_process) {
// case 5 : // case 5 :
try { try {
array_foreach(create_list, function(node) /*=>*/ {return node.preConnect()} ); array_foreach(create_list, function(n) /*=>*/ {return n.preConnect()} );
array_foreach(create_list, function(node) /*=>*/ {return node.connect()} ); array_foreach(create_list, function(n) /*=>*/ {return n.connect()} );
array_foreach(create_list, function(node) /*=>*/ {return node.postConnect()} ); array_foreach(create_list, function(n) /*=>*/ {return n.postConnect()} );
} catch(e) { } catch(e) {
log_warning("LOAD, connect", exception_print(e)); log_warning("LOAD, connect", exception_print(e));
} }
@ -133,19 +121,13 @@ switch(load_process) {
// break; // break;
// case 6 : // case 6 :
try { try { array_foreach(create_list, function(n) /*=>*/ {return n.postLoad()}); }
array_foreach(create_list, function(node) { node.postLoad(); } ); catch(e) { log_warning("LOAD, connect", exception_print(e)); }
} catch(e) {
log_warning("LOAD, connect", exception_print(e));
}
printIf(log, $" > Post load : {(get_timer() - t1) / 1000} ms"); t1 = get_timer(); printIf(log, $" > Post load : {(get_timer() - t1) / 1000} ms"); t1 = get_timer();
try { try { array_foreach(create_list, function(n) /*=>*/ {return n.clearInputCache()}); }
array_foreach(create_list, function(node) { node.clearInputCache(); } ); catch(e) { log_warning("LOAD, connect", exception_print(e)); }
} catch(e) {
log_warning("LOAD, connect", exception_print(e));
}
load_noti.progress = 0.95; load_noti.progress = 0.95;
printIf(log, $" > Clear cache : {(get_timer() - t1) / 1000} ms"); t1 = get_timer(); printIf(log, $" > Clear cache : {(get_timer() - t1) / 1000} ms"); t1 = get_timer();