@@ -281,11 +281,9 @@ void PrepareRenderEvent(in RenderBatch renderBatch)
281281
282282 void LoadChangesIntoRenderEvent ( int componentId )
283283 {
284- var status = renderEvent . GetStatus ( componentId ) ;
284+ var status = renderEvent . GetOrCreateStatus ( componentId ) ;
285285 if ( status . FramesLoaded || status . Disposed )
286- {
287286 return ;
288- }
289287
290288 var frames = GetCurrentRenderTreeFrames ( componentId ) ;
291289 renderEvent . AddFrames ( componentId , frames ) ;
@@ -300,15 +298,15 @@ void LoadChangesIntoRenderEvent(int componentId)
300298 // render tree frames. This can also cause a stack overflow if
301299 // the current component was previously a child of the disposed
302300 // component (is that possible?)
303- var childStatus = renderEvent . GetStatus ( frame . ComponentId ) ;
301+ var childStatus = renderEvent . GetOrCreateStatus ( frame . ComponentId ) ;
304302 if ( childStatus . Disposed )
305303 {
306304 logger . LogDisposedChildInRenderTreeFrame ( componentId , frame . ComponentId ) ;
307305 }
308306 // The assumption is that a component cannot be in multiple places at
309307 // once. However, in case this is not a correct assumption, this
310308 // ensures that a child components frames are only loaded once.
311- else if ( ! renderEvent . GetStatus ( frame . ComponentId ) . FramesLoaded )
309+ else if ( ! renderEvent . GetOrCreateStatus ( frame . ComponentId ) . FramesLoaded )
312310 {
313311 LoadChangesIntoRenderEvent ( frame . ComponentId ) ;
314312 }
@@ -343,11 +341,7 @@ void InvokeApplyRenderEvent()
343341 // CPU cache updates not happening immediately).
344342 //
345343 // There is no guarantee a caller/test framework has set a sync context.
346- usersSyncContext . Send ( static ( state ) =>
347- {
348- var ( renderEvent , renderer ) = ( ( RenderEvent , TestRenderer ) ) state ! ;
349- renderer . ApplyRenderEvent ( renderEvent ) ;
350- } , ( renderEvent , this ) ) ;
344+ usersSyncContext . Send ( _ => ApplyRenderEvent ( renderEvent ) , null ) ;
351345 }
352346 else
353347 {
0 commit comments