mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare][apps] Memory leaks
Change-Id: I2338760fb52bcf57997f7d82fd1f5cee68e95266
This commit is contained in:
@@ -86,6 +86,7 @@ Evaluation<double> * Calculation::output(Context * context) {
|
||||
Expression * exp = Expression::parse(m_outputText);
|
||||
if (exp != nullptr) {
|
||||
m_output = exp->evaluate<double>(*context);
|
||||
delete exp;
|
||||
} else {
|
||||
m_output = new Complex<double>(Complex<double>::Float(NAN));
|
||||
}
|
||||
|
||||
@@ -91,7 +91,9 @@ Evaluation<U> * ComplexMatrix<T>::templatedEvaluate(Context& context, Expression
|
||||
for (int i = 0; i < m_numberOfColumns*m_numberOfRows; i++) {
|
||||
values[i] = Complex<U>::Cartesian(m_values[i].a(), m_values[i].b());
|
||||
}
|
||||
return new ComplexMatrix<U>(values, m_numberOfRows, m_numberOfColumns);
|
||||
Evaluation<U> * result = new ComplexMatrix<U>(values, m_numberOfRows, m_numberOfColumns);
|
||||
delete [] values;
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -62,10 +62,14 @@ Evaluation<T> * Opposite::computeOnMatrix(Evaluation<T> * m) {
|
||||
template<typename T>
|
||||
Evaluation<T> * Opposite::templatedEvaluate(Context& context, AngleUnit angleUnit) const {
|
||||
Evaluation<T> * operandEvalutation = m_operand->evaluate<T>(context, angleUnit);
|
||||
Evaluation<T> * result = nullptr;
|
||||
if (operandEvalutation->numberOfRows() == 1 && operandEvalutation->numberOfColumns() == 1) {
|
||||
return new Complex<T>(compute(*(operandEvalutation->complexOperand(0))));
|
||||
result = new Complex<T>(compute(*(operandEvalutation->complexOperand(0))));
|
||||
} else {
|
||||
result = computeOnMatrix(operandEvalutation);
|
||||
}
|
||||
return computeOnMatrix(operandEvalutation);
|
||||
delete operandEvalutation;
|
||||
return result;
|
||||
}
|
||||
|
||||
ExpressionLayout * Opposite::privateCreateLayout(FloatDisplayMode floatDisplayMode, ComplexFormat complexFormat) const {
|
||||
|
||||
Reference in New Issue
Block a user