[mono] fix signals parameter retrieval

(cherry picked from commit 7a72395412)
This commit is contained in:
Paul Joannon 2018-02-21 12:50:05 +01:00 committed by Hein-Pieter van Braam
parent 6635f2a108
commit 81eb60434a
1 changed files with 7 additions and 5 deletions

View File

@ -230,12 +230,14 @@ String GDMonoMethod::get_signature_desc(bool p_namespaces) const {
} }
void GDMonoMethod::get_parameter_names(Vector<StringName> &names) const { void GDMonoMethod::get_parameter_names(Vector<StringName> &names) const {
const char *_names = memnew_arr(char, params_count); if (params_count > 0) {
mono_method_get_param_names(mono_method, &_names); const char **_names = memnew_arr(const char *, params_count);
for (int i = 0; i < params_count; ++i) { mono_method_get_param_names(mono_method, _names);
names.push_back(StringName(&_names[i])); 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 { void GDMonoMethod::get_parameter_types(Vector<ManagedType> &types) const {