kockie69 / SquinkyVCV-main

GNU General Public License v3.0
22 stars 12 forks source link

I'm afraid the Colored Noise module is still going to crash #28

Closed squinkylabs closed 2 years ago

squinkylabs commented 2 years ago

If you look, the Noise drawer was always deleted by the std::unique_ptr that controlled it's lifetime. It's nice that moving the destruction order as you did made the crash go away, but it is a pretty small change, and if it was wrong before it's probably still wrong.

https://en.cppreference.com/w/cpp/memory/unique_ptr/~unique_ptr

kockie69 commented 2 years ago

No worries, I will have a look. But I just don't understand why we have to make these changes, as my thoughts were as you said the object should be deleted. But I spotted that is not the case. By making my change it worked much better (maybe not all the time). It all feels like workarounds to me. In theory we shouldn't have to do anything (as far as I know) but apparently we have. To me it feels there is something else wrong.

squinkylabs commented 2 years ago

yeah, I agree with what you say. That's why I was wondering if NYSTHI's solution might be better. But really it should be a question for Andrew how to manage these, since he says you aren't supposed to hold onto a bitmap at all (but he may be talking about something else).

Maybe I will ask him (although he rarely answers my queries). Posted here: https://community.vcvrack.com/t/what-is-the-correct-way-to-handle-textures-for-v2/14336

kockie69 commented 2 years ago

According to Andrews answer I have updated and override oncontextdestroy. Seems to work...

squinkylabs commented 2 years ago

awesome!