1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Do not allow adding tasks while in the middle of flushing a message queue

This commit is contained in:
Juan Linietsky
2019-01-14 10:59:28 -03:00
parent c6b587636b
commit 4bb0080b3d
3 changed files with 18 additions and 0 deletions

View File

@@ -166,6 +166,11 @@ void ProgressDialog::_popup() {
void ProgressDialog::add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel) {
if (MessageQueue::get_singleton()->is_flushing()) {
ERR_PRINT("Do not use progress dialog (task) while flushing the message queue or using call_deferred()!");
return;
}
ERR_FAIL_COND(tasks.has(p_task));
ProgressDialog::Task t;
t.vb = memnew(VBoxContainer);