mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-29 11:39:58 +02:00
[poincare] Correct memory leaking issue
Change-Id: Ide22a702f7a23b140cad7cd61f4543355b2de8f6
This commit is contained in:
@@ -40,13 +40,11 @@ Expression * Power::evaluateOnMatrixAndInteger(Matrix * m, Integer * i, Context&
|
||||
Expression * operands[2];
|
||||
operands[0] = result;
|
||||
operands[1] = m;
|
||||
Expression * next = new Product(operands, true);
|
||||
/* We do not need to suppress next, as we suppress result and m is handle by
|
||||
* another scope (TODO: something feels wrong. Check again) */
|
||||
Expression * newResult = next->evaluate(context);
|
||||
Expression * product = new Product(operands, true);
|
||||
Expression * newResult = product->evaluate(context);
|
||||
delete result;
|
||||
result = newResult;
|
||||
delete next;
|
||||
delete product;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user