Skip to content

Commit

Permalink
free memory the clean way
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolaj Bjorner <[email protected]>
  • Loading branch information
NikolajBjorner committed Jan 20, 2024
1 parent d32dcfc commit 910b302
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/math/polynomial/algebraic_numbers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ namespace algebraic_numbers {
return m_upmanager;
}

void del(basic_cell * c) {
void del_basic(basic_cell * c) {
qm().del(c->m_value);
m_allocator.deallocate(sizeof(basic_cell), c);
}
Expand All @@ -207,7 +207,7 @@ namespace algebraic_numbers {
if (a.is_null())
return;
if (a.is_basic())
del(a.to_basic());
del_basic(a.to_basic());
else
del(a.to_algebraic());
a.clear();
Expand Down Expand Up @@ -795,7 +795,7 @@ namespace algebraic_numbers {
// root was found
scoped_mpq r(qm());
to_mpq(qm(), lower(c), r);
del(c);
del(a);
a = mk_basic_cell(r);
return false;
}
Expand Down

0 comments on commit 910b302

Please sign in to comment.