[WIP] Improve memory management of matrix maps

This commit is contained in:
Adam Honse
2026-01-09 01:19:20 -06:00
parent d258e3551f
commit af04dd8d58
68 changed files with 235 additions and 608 deletions

View File

@@ -49,22 +49,6 @@ RGBController_CMKeyboardController::RGBController_CMKeyboardController(CMKeyboar
RGBController_CMKeyboardController::~RGBController_CMKeyboardController()
{
/*---------------------------------------------------------*\
| Delete the matrix map |
\*---------------------------------------------------------*/
for(unsigned int zone_index = 0; zone_index < zones.size(); zone_index++)
{
if(zones[zone_index].matrix_map != NULL)
{
if(zones[zone_index].matrix_map->map != NULL)
{
delete zones[zone_index].matrix_map->map;
}
delete zones[zone_index].matrix_map;
}
}
if(m_pController)
{
delete m_pController;
@@ -111,6 +95,7 @@ void RGBController_CMKeyboardController::SetupZones()
new_map->height = new_kb.GetRowCount();
new_map->width = new_kb.GetColumnCount();
new_map->delete_map = true;
new_map->map = new unsigned int[new_map->height * new_map->width];
/*---------------------------------------------------------*\