4 ms·
I think I would be using std::unique_ptr here instead of the manual memory management, which as you can see sometimes fails spectacularly. I've had codebases my
by fwsgonzo 2y ago
I think I would be using std::unique_ptr here instead of the manual memory management, which as you can see sometimes fails spectacularly. I've had codebases myself ~10 years ago where I didn't really know how to use them properly, and I eventually completely gave up on them. The code was just too unreliable. These days, writing C++ is just like writing Python to me. The language is rarely the problem as long as I keep on the happy path with RAII.
I did see your issue immediately, though, and I could remember having the same issue with my own code. I remember assigning Shaders into a shader manager. They were already dead.
These days I prefer to in-place construct most things, unless there's a particular reason for assignment.