'Internal: JobTempAlloc' Error
I'm on PUN 2 v2.22 (07. September 2020)
Unity 2019.4.4f1
I'm having
internal: jobtempalloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
error and I tracked it down to scene change.
The error occurs during the while loop in the WaitForSceneChange coroutine.
Changing to this
PhotonNetwork.AutomaticallySyncScene = true; also causes the error
Changing that to false no longer shows the error but my loading is messed up. Like player 2 won't see player 1 (host) game object.
Inside of the PhotonNetwork.cs script, changing as show below stops the error. Not sure if it breaks anything else.
Unity 2019.4.4f1
I'm having
internal: jobtempalloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
error and I tracked it down to scene change.
public override void OnCreatedRoom() { JUtil.Log(true, false, "Pun2", 0, $"★ New room created: {PhotonNetwork.CurrentRoom}", gameObject.name, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name); // The initial team size of the game for the server creating a new room. short initialArrayLength; initialArrayLength = 2; // We created a room so we have to set the initial room properties for this room. // Such as populating the team fill and score arrays from our custom properties that extends Photon's Room object. Hashtable roomProps = new Hashtable(); roomProps.Add(RoomExtensions.size, new int[initialArrayLength]); roomProps.Add(RoomExtensions.score, new int[initialArrayLength]); roomProps.Add(RoomExtensions.timer, gameDuration); roomProps.Add(RoomExtensions.bsize, 0); PhotonNetwork.CurrentRoom.SetCustomProperties(roomProps); PhotonNetwork.LoadLevel(gameSceneIndex); } public override void OnJoinedRoom() { if (!PhotonNetwork.IsMasterClient) { JUtil.Log(true, false, "Pun2", 0, $"A room was found: {PhotonNetwork.CurrentRoom}", gameObject.name, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name); return; } JUtil.Log(true, false, "Pun2", 0, $"★ Joined the hosted room. (Scene: {SceneManager.GetActiveScene().name})", gameObject.name, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name); // Add ourselves to the game. // This is only called for the master client because other clients will trigger the OnPhotonPlayerConnected callback directly. //OnPlayerEnteredRoom(PhotonNetwork.LocalPlayer); StartCoroutine(WaitForSceneChange()); } // This wait routine is needed for waiting on completed scene change. IEnumerator WaitForSceneChange() { JUtil.Log(true, false, "Pun2", 0, $"★ 1..(Scene: {SceneManager.GetActiveScene().name})", gameObject.name, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name); while (!IsGameScene) { JUtil.Log(true, false, "Pun2", 0, $"★ 2..(Scene: {SceneManager.GetActiveScene().name})", gameObject.name, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name); yield return null; } OnPlayerEnteredRoom(PhotonNetwork.LocalPlayer); JUtil.Log(true, false, "Pun2", 0, $"★ 3..(Scene: {SceneManager.GetActiveScene().name})", gameObject.name, GetType().Name, System.Reflection.MethodBase.GetCurrentMethod().Name); }
The error occurs during the while loop in the WaitForSceneChange coroutine.
Changing to this
//PhotonNetwork.LoadLevel(gameSceneIndex); SceneManager.LoadScene(gameSceneIndex);removes the error.
PhotonNetwork.AutomaticallySyncScene = true; also causes the error
Changing that to false no longer shows the error but my loading is messed up. Like player 2 won't see player 1 (host) game object.
Received OnSerialization for view ID 1001. We have no such PhotonView! Ignore this if you're joining or leaving a room. State: Joined
Inside of the PhotonNetwork.cs script, changing as show below stops the error. Not sure if it breaks anything else.
//_AsyncLevelLoadingOperation = SceneManager.LoadSceneAsync(levelName, LoadSceneMode.Single); SceneManager.LoadScene(levelName, LoadSceneMode.Single);
0