Posted 1 October 2025, 4:08 am EST - Updated 1 October 2025, 4:30 am EST
We are encountering a critical memory leak issue when repeatedly configuring cell types (specifically Combo Box and Button types) using the Spread COM DLL, version 8.0.29 (the latest available maintenance release).
The memory leak is consistently observed when the code blocks for setting a cell type are executed repeatedly (e.g., thousands of times in a loop).
The memory leak is consistently observed in our Visual Studio 2019 (VS2019) x64 environment.
- Combo Box Cell Type
long _col = 1;
long _row = 1;
bool lCell1Used = false;
SS_CELLTYPE CellTypeComboBox;
CString sComboBoxItems = _T("");
short sCombolStyle = 0;
CellTypeComboBox.Spec.ComboBox.dComboWidth = SS_COMBOWIDTH_CELLWIDTH;
TSpread::SetTypeComboBoxEx(&CellTypeComboBox, sCombolStyle,
sComboBoxItems, 50,
255, CellTypeComboBox.Spec.ComboBox.dComboWidth, NULL, SS_COMBOBOX_AUTOSEARCH_MULTIPLECHAR);
CellTypeComboBox.Spec.ComboBox.dComboWidth = SS_COMBOWIDTH_CELLWIDTH;
if (lCell1Used == true)
TSpread::SetCellType(_col, _row, &CellTypeComboBox);
else
TSpread::SetCellTypeRange(_col, _row, _col2, _row2, &CellTypeComboBox);
- Button Cell Type
long _col = 1;
long _row = 1;
bool lCell1Used = false;
SS_CELLTYPE CellTypeButton;
short sButtonStyle = 0;
CString strButton = _T("");
TSpread::SetTypeButton(
&CellTypeButton,
sButtonStyle, strButton,
NULL, SUPERBTN_PICT_NONE,
NULL, SUPERBTN_PICT_NONE,
SUPERBTN_TYPE_NORMAL,
0, NULL
);
if (lCell1Used == true)
TSpread::SetCellType(_col, _row, &CellTypeButton);
else
TSpread::SetCellTypeRange(_col, _row, _col2, _row2, &CellTypeButton);