Memory leak when editing terrain

Any time I try to edit the terrain in a project I’m working on I keep getting an error after exiting play mode that ALLOC_TEMP_MAIN has unfreed allocations which takes my frame rate from around 150 fps to 0.1 fps. I’ve tried unchecking static on the terrain like I read some people online said might be the issue but that hasn’t helped. None of the lights in the scene are baked and the only program that is open is Unity and sometimes Task Manager or Visual Studio. Is there any way to prevent this other than not going into play mode?
My unity version is 2021.2.7f1 and the exact warning I’m getting is: "Internal: Stack allocator ALLOC_TEMP_MAIN has unfreed allocations, size (continuously increasing number)

Have you tried:

Assets -> Reimport All

I submitted a bug report and Unity said that it is a known issue and is fixed in Unity 2021.2.10f1 and 2022.1.0a13.