summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Joannon <hello@pauljoannon.com>2018-02-21 12:50:05 +0100
committerPaul Joannon <hello@pauljoannon.com>2018-02-21 12:50:05 +0100
commit7a723954125e9409c102b5cf3cde6f9a6464be52 (patch)
treeb1e358fc5b63a8f3d3545b20220575d83fe02f08
parent5d6c64969cea4f1678ed3760c0353f8860ef661b (diff)
[mono] fix signals parameter retrieval
-rw-r--r--modules/mono/mono_gd/gd_mono_method.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/mono/mono_gd/gd_mono_method.cpp b/modules/mono/mono_gd/gd_mono_method.cpp
index 69040a3df8..ad52904945 100644
--- a/modules/mono/mono_gd/gd_mono_method.cpp
+++ b/modules/mono/mono_gd/gd_mono_method.cpp
@@ -230,12 +230,14 @@ String GDMonoMethod::get_signature_desc(bool p_namespaces) const {
}
void GDMonoMethod::get_parameter_names(Vector<StringName> &names) const {
- const char *_names = memnew_arr(char, params_count);
- mono_method_get_param_names(mono_method, &_names);
- for (int i = 0; i < params_count; ++i) {
- names.push_back(StringName(&_names[i]));
+ if (params_count > 0) {
+ const char **_names = memnew_arr(const char *, params_count);
+ mono_method_get_param_names(mono_method, _names);
+ for (int i = 0; i < params_count; ++i) {
+ names.push_back(StringName(_names[i]));
+ }
+ memdelete_arr(_names);
}
- memdelete_arr(_names);
}
void GDMonoMethod::get_parameter_types(Vector<ManagedType> &types) const {