I wrote a small pthread multithreadding programming and i wanted to clean up the pthred_t array which i created. But when I do it I get the error that a glib has been detected. How can I delete the array, or do I simply not need to. The code runs fine without the freeing of the memory but in my opinion the code below causes a (small) memory leek. Thanks
pthread_t* threadNumber = new pthread_t (4);
args var;
var.matrixA=matrixA;
var.matrixB=matrixB;
var.matrixC=matrixC;
var.alpha=alpha;
var.beta=beta;
var.cellCount=0;
var.maxCells=cColumns*cRows;
for (int i =0 ;i<4;++i)
pthread_create(&threadNumber[i],&attr,matrixMultiply,(void *) (&var));
for(int i=0;i<4;++i)
pthread_join(threadNumber[i],NULL);
printMatrix(matrixA,aRows,aColumns);
printMatrix(matrixB,bRows,bColumns);
printMatrix(matrixC,cRows,cColumns);
//delete threadNumber;
//this caused a memory trash
std::vector<pthread_t> threadNumber(4);<- brought to you by SLACK, the Standard Library Awareness Campaign Kids. - R. Martinho Fernandesstd::vector<std::thread>threads(4); - 111111