Matrix * Matrix::transpose()
{
    Matrix *m = new Matrix(*this->numCols, *this->numRows, false);
    for (int i = 0; i < *this->numRows; i++)
    {
        for (int j = 0; j < *this->numCols; j++)
        {
            m->setValue(j, i, this->getValue(i, j));
        }
    }
    return m;
}
Hello all. My memory keeps increasing after transposing matricies. How can i solve that, by deleting returned m(how to do it?) or deleting this->~Matrix() ?
 
    