Avoid use after free in RowColumnManager.cpp

Fixes CID 10862
This commit is contained in:
Alex Wilson 2012-01-24 12:47:24 +13:00
parent 681f48fcbc
commit 0bd511a331

View File

@ -69,8 +69,8 @@ RowColumnManager::RemoveArea(Area* area)
if (row->fAreas.CountItems() == 0) { if (row->fAreas.CountItems() == 0) {
fRows.RemoveItem(row); fRows.RemoveItem(row);
delete row; delete row;
} } else
_UpdateConstraints(row); _UpdateConstraints(row);
} }
Column* column = area->fColumn; Column* column = area->fColumn;
@ -80,8 +80,8 @@ RowColumnManager::RemoveArea(Area* area)
if (column->fAreas.CountItems() == 0) { if (column->fAreas.CountItems() == 0) {
fColumns.RemoveItem(column); fColumns.RemoveItem(column);
delete column; delete column;
} } else
_UpdateConstraints(column); _UpdateConstraints(column);
} }
} }