mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-02 09:40:35 +00:00
(svn r21679) -Fix (r21642): reading a just freed variable
This commit is contained in:
parent
582472d626
commit
64c7cc51b5
@ -1747,9 +1747,10 @@ void Vehicle::BeginLoading()
|
||||
current_order.MakeLoading(true);
|
||||
UpdateVehicleTimetable(this, true);
|
||||
|
||||
for (Order *order = this->GetOrder(this->cur_order_index);
|
||||
order != NULL && order->IsType(OT_AUTOMATIC);
|
||||
order = order->next) {
|
||||
const Order *order = this->GetOrder(this->cur_order_index);
|
||||
while (order != NULL && order->IsType(OT_AUTOMATIC)) {
|
||||
/* Delete order effectively deletes order, so get the next before deleting it. */
|
||||
order = order->next;
|
||||
DeleteOrder(this, this->cur_order_index);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user