//GetVertexData
//Returns the vertex data
virtual void *GetVertexData()
{
T *vertexData = (T *)malloc(m_numVertices * sizeof(T));
for(int i = 0; i < m_numVertices; i++)
{
vertexData[i] = m_vertexData.at(i);
}
return (void *)vertexData;
}
As far as I can see there is nothing wrong with this code. It simply takes data from a std::vector and puts it in vertexData. But for some reason malloc is returning 0 so no memory is allocated for the pointer. I've done some debugging and m_numVertices is definatly non-null as is sizeof(T) (This is a templated function BTW). In fact the values are something like m_numVertices = 12 and sizeof(T) = 24. Any ideas why it would return 0?












