mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 22:30:30 +01:00
[apps][escher] Do not forget to delete dynamic objects when reassigning
then or destructing them Change-Id: If2b4de460163bf187152389e419d87329b83fc39
This commit is contained in:
committed by
Romain Goyet
parent
276504e978
commit
7406e0d775
@@ -13,6 +13,15 @@ SequenceToolbox::SequenceToolbox() :
|
||||
{
|
||||
}
|
||||
|
||||
SequenceToolbox::~SequenceToolbox() {
|
||||
for (int i = 0; i < k_maxNumberOfDisplayedRows; i++) {
|
||||
if (m_addedCellLayout[i]) {
|
||||
delete m_addedCellLayout[i];
|
||||
m_addedCellLayout[i] = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SequenceToolbox::handleEvent(Ion::Events::Event event) {
|
||||
if (event == Ion::Events::OK && stackDepth() == 0) {
|
||||
int selectedRow = m_selectableTableView.selectedRow();
|
||||
@@ -65,6 +74,12 @@ int SequenceToolbox::typeAtLocation(int i, int j) {
|
||||
}
|
||||
|
||||
void SequenceToolbox::setExtraCells(const char * sequenceName, int recurrenceDepth) {
|
||||
for (int i = 0; i < k_maxNumberOfDisplayedRows; i++) {
|
||||
if (m_addedCellLayout[i]) {
|
||||
delete m_addedCellLayout[i];
|
||||
m_addedCellLayout[i] = nullptr;
|
||||
}
|
||||
}
|
||||
m_numberOfAddedCells = recurrenceDepth;
|
||||
for (int j = 0; j < recurrenceDepth; j++) {
|
||||
m_addedCellLayout[j] = new BaselineRelativeLayout(new StringLayout(sequenceName, 1, KDText::FontSize::Large), new StringLayout((char *)(j == 0? "n" : "n+1"), strlen((char *)(j == 0? "n" : "n+1")), KDText::FontSize::Small), BaselineRelativeLayout::Type::Subscript);
|
||||
|
||||
Reference in New Issue
Block a user