File tree 1 file changed +7
-17
lines changed
src/UnityDebuggerAssistant/Components
1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change 1
- using System . Collections ;
1
+ using System ;
2
2
using UnityDebuggerAssistant . Patches ;
3
3
using UnityDebuggerAssistant . Utils ;
4
4
using UnityEngine ;
@@ -13,33 +13,23 @@ private void Start()
13
13
BepinExPluginMarshal . Run ( ) ;
14
14
15
15
Plugin . Log ? . LogInfo ( "UDA starting patch processor cycle" ) ;
16
- StartCoroutine ( CheckPatches ( ) ) ;
17
16
18
17
#if DEBUG
19
18
UDAExceptionHandler . DebugThrow ( ) ;
20
19
#endif
21
20
}
22
21
23
- internal IEnumerator CheckPatches ( )
22
+ private void Update ( )
24
23
{
25
- yield return new WaitForEndOfFrame ( ) ;
24
+ var storage = ExceptionConstructorPatch . Storage ;
26
25
27
- if ( ExceptionConstructorPatch . Storage . Count > 0 )
26
+ if ( storage . TryPop ( out Exception result ) )
28
27
{
29
-
30
28
#if DEBUG
31
- Plugin . Log ? . LogInfo ( $ "No. to process { ExceptionConstructorPatch . Storage . Count } ") ;
32
- #endif
33
-
34
- foreach ( var item in ExceptionConstructorPatch . Storage )
35
- {
36
- UDAExceptionHandler . Handle ( item ) ;
37
- }
38
-
39
- ExceptionConstructorPatch . Storage . Clear ( ) ;
29
+ Plugin . Log ? . LogInfo ( "Popping from stack this frame" ) ;
30
+ #endif
31
+ ExceptionProcessor . Run ( result ) ;
40
32
}
41
33
42
- StartCoroutine ( CheckPatches ( ) ) ;
43
- yield break ;
44
34
}
45
35
}
You can’t perform that action at this time.
0 commit comments