summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-05-05 23:09:30 +0200
committerGitHub <noreply@github.com>2017-05-05 23:09:30 +0200
commit18df047f0b3a61ffb97d7bb64c7579a9e8b6c80f (patch)
treee81d44d04328bcaea660eb377f8bff5a7901f4a0
parenta853b0a2f7df5258ec64635df5d3ff06ceb5e1aa (diff)
parent1a7aafa90d48651f1a8252d00c3801d7f1f8fe2c (diff)
Merge pull request #8658 from Faless/explain_out_of_mem_msg_queue_master
Better explain out of memory error in message queue
-rw-r--r--core/message_queue.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/message_queue.cpp b/core/message_queue.cpp
index 14e8913d9f..fa1c8112cc 100644
--- a/core/message_queue.cpp
+++ b/core/message_queue.cpp
@@ -51,9 +51,10 @@ Error MessageQueue::push_call(ObjectID p_id, const StringName &p_method, const V
type = ObjectDB::get_instance(p_id)->get_class();
print_line("failed method: " + type + ":" + p_method + " target ID: " + itos(p_id));
statistics();
+ ERR_EXPLAIN("Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings");
+ ERR_FAIL_V(ERR_OUT_OF_MEMORY);
}
- ERR_FAIL_COND_V((buffer_end + room_needed) >= buffer_size, ERR_OUT_OF_MEMORY);
Message *msg = memnew_placement(&buffer[buffer_end], Message);
msg->args = p_argcount;
msg->instance_ID = p_id;
@@ -101,10 +102,10 @@ Error MessageQueue::push_set(ObjectID p_id, const StringName &p_prop, const Vari
type = ObjectDB::get_instance(p_id)->get_class();
print_line("failed set: " + type + ":" + p_prop + " target ID: " + itos(p_id));
statistics();
+ ERR_EXPLAIN("Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings");
+ ERR_FAIL_V(ERR_OUT_OF_MEMORY);
}
- ERR_FAIL_COND_V((buffer_end + room_needed) >= buffer_size, ERR_OUT_OF_MEMORY);
-
Message *msg = memnew_placement(&buffer[buffer_end], Message);
msg->args = 1;
msg->instance_ID = p_id;
@@ -134,9 +135,10 @@ Error MessageQueue::push_notification(ObjectID p_id, int p_notification) {
type = ObjectDB::get_instance(p_id)->get_class();
print_line("failed notification: " + itos(p_notification) + " target ID: " + itos(p_id));
statistics();
+ ERR_EXPLAIN("Message queue out of memory. Try increasing 'message_queue_size_kb' in project settings");
+ ERR_FAIL_V(ERR_OUT_OF_MEMORY);
}
- ERR_FAIL_COND_V((buffer_end + room_needed) >= buffer_size, ERR_OUT_OF_MEMORY);
Message *msg = memnew_placement(&buffer[buffer_end], Message);
msg->type = TYPE_NOTIFICATION;