You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thx a lot for all your articles and code examples they are really useful. I'm integrating a CVar system based on your example inside my own engine and I think I found a trivial memory leak inside the example code here:
Line 49 you are doing a dynamic allocation for the CVarStorage array but you never delete this array inside the code. Adding:
~CVarArray()
{
delete[] cvars;
cvars = nullptr;
}
Right after the constructor should fix the issue if ever you want to fix it.
Also inside the article:
//checkbox CVAR
AutoCVar_Int CVAR_TestCheckbox("test.checkbox", "just a checkbox", 0, CVarFlags::EditCheckbox);
//int CVAR
AutoCVar_Int CVAR_TestInt("test.int", "just a configurable int", 42);
//float CVAR
AutoCVar_Int CVAR_TestFloat("test.float", "just a configurable float", 13.37);
//string CVAR
AutoCVar_String CVAR_TestString("test.string", "just a configurable string", "just a configurable string");
There is a small typo for the float CVar example. It Should use AutoCVar_Float instead of AutoCVar_Int (it won't compile anyway as the last argument is a double and not an int). Again it's trivial if ever you want to fix it.
Thx again for all the resources.
The text was updated successfully, but these errors were encountered:
Hi !
First, thx a lot for all your articles and code examples they are really useful. I'm integrating a CVar system based on your example inside my own engine and I think I found a trivial memory leak inside the example code here:
https://github.com/vblanco20-1/vulkan-guide/blob/engine/extra-engine/cvars.cpp
Line 49 you are doing a dynamic allocation for the CVarStorage array but you never delete this array inside the code. Adding:
Right after the constructor should fix the issue if ever you want to fix it.
Also inside the article:
There is a small typo for the float CVar example. It Should use AutoCVar_Float instead of AutoCVar_Int (it won't compile anyway as the last argument is a double and not an int). Again it's trivial if ever you want to fix it.
Thx again for all the resources.
The text was updated successfully, but these errors were encountered: