File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 24
24
****************************************************************************/
25
25
26
26
cc . game . restart = function ( ) {
27
- // Need to clear scene, or native object destructor won't be invoke.
28
- cc . director . getScene ( ) . destroy ( ) ;
29
- cc . Object . _deferredDestroy ( ) ;
30
- __restartVM ( ) ;
27
+ return new Promise ( ( resolve ) => {
28
+ // Need to clear scene, or native object destructor won't be invoked.
29
+ cc . director . getScene ( ) . destroy ( ) ;
30
+ cc . Object . _deferredDestroy ( ) ;
31
+ __restartVM ( ) ;
32
+
33
+ // Resolve the promise to indicate completion
34
+ resolve ( ) ;
35
+ } ) ;
31
36
} ;
32
37
33
- jsb . onError ( function ( location , message , stack ) {
38
+ jsb . onError ( ( location , message , stack ) => {
34
39
console . error ( location , message , stack ) ;
35
40
} ) ;
36
41
You can’t perform that action at this time.
0 commit comments