It uses lists and adds a single callback to the EditorApplication.update delegate.
It is based on a solution I use internally and the comment @jacobdufault made on #187.
I quickly tested and it seems to work, but would appreciate a review before merging.
I'm amazed I hadn't noticed this issue until @hymerman mentioned. I guess I just crash Unity so much that I rarely go long enough for it to became apparent.
Today, I just left Unity sit open and active for a few hours (the computer didn't sleep because Windows) and when I came back I though I had a memory leak on my mesh generation. Turns out it was this issue. It was allocating over a megabyte per frame!
This is an alternative PR for #187
It uses lists and adds a single callback to the EditorApplication.update delegate. It is based on a solution I use internally and the comment @jacobdufault made on #187.
I quickly tested and it seems to work, but would appreciate a review before merging.
I'm amazed I hadn't noticed this issue until @hymerman mentioned. I guess I just crash Unity so much that I rarely go long enough for it to became apparent.
Today, I just left Unity sit open and active for a few hours (the computer didn't sleep because Windows) and when I came back I though I had a memory leak on my mesh generation. Turns out it was this issue. It was allocating over a megabyte per frame!
Really glad @hymerman brought this up!