mirror of
https://gitlab.com/klmp200/LO27.git
synced 2024-11-26 01:14:15 +00:00
corrigé free
This commit is contained in:
parent
0dfa280bfc
commit
98e08eab35
@ -83,7 +83,7 @@ bool CreateMatrixElem(Matrix matrix, int ColPos, int RowPos){
|
||||
} else if (Col->data->rowIndex > RowPos){
|
||||
elem->nextRow = Col->data;
|
||||
Col->data = elem;
|
||||
} else {
|
||||
} else {NMWZxm5uQt
|
||||
tmp = Col->data;
|
||||
while (tmp->nextRow != NULL && tmp->nextRow->rowIndex < RowPos){
|
||||
tmp=tmp->nextRow;
|
||||
@ -295,18 +295,22 @@ bool RecursiveFreeCol(Matrix matrix, cellElement * elem){
|
||||
|
||||
|
||||
Matrix freeMatrix(Matrix matrix){
|
||||
ListElement * current = NULL;
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
|
||||
printf("\n---FREE MATRIX---\n");
|
||||
|
||||
for (i=0;i<matrix.rowCount;i++){
|
||||
for (j=0;j<matrix.colCount;j++){
|
||||
|
||||
SetCellValue(matrix,j,i,false);
|
||||
|
||||
matrix.colCount = 0;
|
||||
matrix.rowCount = 0;
|
||||
|
||||
if (matrix.cols != NULL){
|
||||
current= matrix.cols->head;
|
||||
while (current != NULL){
|
||||
RecursiveFreeCol(matrix,current->data);
|
||||
current = current->next;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
printf("---END OF MATRIX---\n\n");
|
||||
FreeList(matrix.cols);
|
||||
FreeList(matrix.rows);
|
||||
return matrix;
|
||||
|
Loading…
Reference in New Issue
Block a user