Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

TLS allocator ALLOC_TEMP_THREAD, underlying allocator

Discussion in 'Editor & General Support' started by kirrwed, Jan 16, 2022.

  1. kirrwed

    kirrwed

    Joined:
    Jan 15, 2022
    Posts:
    12
    Console error reads:
    TLS allocator ALLOC_TEMP_THREAD, underlying allocator ALLOC_TEMP_THREAD has unfreed allocations, size 151

    I've seen a number of threads in the past year or two asking what this error is and no one seems to have a solution. Is it still a mystery in 2022?

    I'm at beginner level. Followed a tutorial from udemy class to move a very basic sphere around screen with WASD controls. The error started when clicking in the hierarchy window during "game" mode, which also disabled the controls even though I was still in game mode. It prevented the ability to watch the Inspector figures change as the movement was tested live.
     
  2. Francesco-FL

    Francesco-FL

    Joined:
    May 25, 2021
    Posts:
    176
    Sometimes I get a similar error when somewhere I was throwing a StackOverflowException. To make the error go away, I closed the project and reopened it, then fixed the code to avoid the error.
     
  3. kirrwed

    kirrwed

    Joined:
    Jan 15, 2022
    Posts:
    12
    Thank you. I don't have such a code. Mine is fairly simple as follows:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class Movement : MonoBehaviour
    6. {
    7.     Rigidbody rb;
    8.     public float speed = 5;
    9.     float horizontalDirection;
    10.     float verticalDirection;
    11.     // Start is called before the first frame update
    12.     void Start()
    13.     {
    14.         rb = GetComponent<Rigidbody>();
    15.     }
    16.  
    17.     // Update is called once per frame
    18.     void Update()
    19.     {
    20.         horizontalDirection = Input.GetAxis("Horizontal");
    21.         verticalDirection = Input.GetAxis("Vertical");
    22.     }
    23.  
    24.     public void FixedUpdate()
    25.     {
    26.         Move();
    27.     }
    28.     public void Move()
    29.     {
    30.         float horizontalSpeed = horizontalDirection * (speed * 100) * Time.deltaTime;
    31.         float verticalSpeed = verticalDirection * (speed * 100) * Time.deltaTime;
    32.         if(horizontalSpeed !=0)
    33.         {
    34.             rb.velocity = new Vector3(horizontalSpeed, rb.velocity.y, rb.velocity.z);
    35.         }
    36.         if(verticalSpeed !=0)
    37.         {
    38.             rb.velocity = new Vector3(rb.velocity.x, rb.velocity.y, verticalSpeed);
    39.         }
    40.     }
    41.  
    42. }
    43.  
     
  4. kirrwed

    kirrwed

    Joined:
    Jan 15, 2022
    Posts:
    12
    Well...for my own reference or anyone who had my similar problem.... I saved the project and quit Unity. Went back in and initiated Game mode. Was able to move ball around but as soon as clicked item in hierarchy window, the controls became disabled. I didn't get the error message in console though. I exited game mode. Highlighted the object in hierarchy *first*. And then entered game mode. And when I moved the object around, I could see the Inspector adjust the data live.
     
  5. sillyninja65

    sillyninja65

    Joined:
    Dec 1, 2022
    Posts:
    9
    sound like unity NEED TO FIX THIS PROBLEM. its been a long requested problem that doesnt seem to have been fixed at all.

    just reopen the project when this gets bad, either that or reimport all assets but this could mess up scripts, not the code but all the connections in the editor