Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Adjusting the job handle name.
Migrating the m_FlushSendJobHandle.Complete(); outside of the driver IsCreated check to avoid any potential job safety issues.
  • Loading branch information
NoelStephensUnity committed Oct 31, 2024
1 parent c0d2cbf commit 85e7b2b
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,11 @@ private bool ProcessEvent()
return false;
}

private JobHandle m_FlushSendJobHandle;

internal override void EarlyUpdate()
{
m_FlushSendJobHandle.Complete();
if (m_Driver.IsCreated)
{
if (m_ProtocolType == ProtocolType.RelayUnityTransport && m_Driver.GetRelayConnectionStatus() == RelayConnectionStatus.AllocationInvalid)
Expand All @@ -959,10 +962,6 @@ internal override void EarlyUpdate()

m_Driver.ScheduleUpdate().Complete();

// Schedule a flush send as the last transport action for the
// current frame.
m_Driver.ScheduleFlushSend(default).Complete();

while (AcceptConnection() && m_Driver.IsCreated)
{
;
Expand All @@ -984,11 +983,9 @@ internal override void PostLateUpdate()
SendBatchedMessages(kvp.Key, kvp.Value);
}

m_Driver.ScheduleUpdate();

// Schedule a flush send as the last transport action for the
// current frame.
m_Driver.ScheduleFlushSend(default);
m_FlushSendJobHandle = m_Driver.ScheduleFlushSend(default);
}

#if MULTIPLAYER_TOOLS_1_0_0_PRE_7
Expand Down

0 comments on commit 85e7b2b

Please sign in to comment.