Hi all, I'm having a pointer problem where on the close of a method, the system attempts to delete local pointers and crashes. There's a bit of a chain of events going on, so I'll post code snippets in order as best as possible.
The problem probably isn't here, but just in case:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Matrix* Matrix::getCol(constint col)
{
Matrix* mat = new Matrix(m_rows, 1);
for (int i = 0; i < m_rows; i++)
{
mat->set(i, 0, get(i, col));
}
return mat;
}
Matrix* Matrix::getRow(constint row)
{
Matrix* mat = new Matrix(1, m_cols);
for (int i = 0; i < m_cols; i++)
{
mat->set(0, i, get(row, i));
}
return mat;
}
Thanks a ton in advance for any sort of help. Also, I tested all these methods out using simple test code in main(). I was surprised when it started acting up in a class.
I don't do any explicit deletes. It's a very simple program that's only being used for learning, so there's no error checking. When I debugged the program, I found that at the very end of dotProduct(), the function in new_allocator.h is being called, which is where the program crashes.