mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fix crash when no active tasks
This commit is contained in:
parent
00a3bd8462
commit
eccea893f3
@ -1357,18 +1357,20 @@ do_write(ostream &out, int indent_level) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sort(tasks.begin(), tasks.end(), AsyncTaskSortPriority());
|
|
||||||
|
|
||||||
double now = _manager->_clock->get_frame_time();
|
double now = _manager->_clock->get_frame_time();
|
||||||
|
|
||||||
// Since AsyncTaskSortPriority() sorts backwards (because of STL's
|
if (!tasks.empty()) {
|
||||||
// push_heap semantics), we go through the task list in reverse
|
sort(tasks.begin(), tasks.end(), AsyncTaskSortPriority());
|
||||||
// order to print them forwards.
|
TaskHeap::reverse_iterator ti;
|
||||||
TaskHeap::reverse_iterator ti;
|
int current_sort = tasks.back()->get_sort() - 1;
|
||||||
int current_sort = tasks.back()->get_sort() - 1;
|
|
||||||
for (ti = tasks.rbegin(); ti != tasks.rend(); ++ti) {
|
// Since AsyncTaskSortPriority() sorts backwards (because of STL's
|
||||||
AsyncTask *task = (*ti);
|
// push_heap semantics), we go through the task list in reverse
|
||||||
write_task_line(out, indent_level, task, now);
|
// order to print them forwards.
|
||||||
|
for (ti = tasks.rbegin(); ti != tasks.rend(); ++ti) {
|
||||||
|
AsyncTask *task = (*ti);
|
||||||
|
write_task_line(out, indent_level, task, now);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Instead of iterating through the _sleeping list in heap order,
|
// Instead of iterating through the _sleeping list in heap order,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user