Memory Leak when repeatedly setting Cell Types

Posted by: minho.shin98 on 1 October 2025, 4:08 am EST

  • 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.

    1. 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);
    
    1. 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);
    
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels