mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 06:15:04 +00:00
(svn r12993) -Fix (r11175): list used for sorting GRFs wasn't freed
This commit is contained in:
parent
0c4715d825
commit
c3822e3a90
@ -406,7 +406,6 @@ void ScanNewGRFFiles()
|
|||||||
* For that we first have to make an array, the qsort and
|
* For that we first have to make an array, the qsort and
|
||||||
* then remake the linked list. */
|
* then remake the linked list. */
|
||||||
GRFConfig **to_sort = MallocT<GRFConfig*>(num);
|
GRFConfig **to_sort = MallocT<GRFConfig*>(num);
|
||||||
if (to_sort == NULL) return; // No memory, then don't sort
|
|
||||||
|
|
||||||
uint i = 0;
|
uint i = 0;
|
||||||
for (GRFConfig *p = _all_grfs; p != NULL; p = p->next, i++) {
|
for (GRFConfig *p = _all_grfs; p != NULL; p = p->next, i++) {
|
||||||
@ -422,6 +421,8 @@ void ScanNewGRFFiles()
|
|||||||
}
|
}
|
||||||
to_sort[num - 1]->next = NULL;
|
to_sort[num - 1]->next = NULL;
|
||||||
_all_grfs = to_sort[0];
|
_all_grfs = to_sort[0];
|
||||||
|
|
||||||
|
free(to_sort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user