1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Mono: Pending exceptions and cleanup

This commit is contained in:
Ignacio Etcheverry
2018-06-26 21:03:42 +02:00
parent 68f7cf13c7
commit 4739cb8c00
23 changed files with 720 additions and 193 deletions

View File

@@ -47,11 +47,11 @@ String generate_core_api_project(const String &p_dir, const Vector<String> &p_fi
Variant dir = p_dir;
Variant compile_items = p_files;
const Variant *args[2] = { &dir, &compile_items };
MonoObject *ex = NULL;
MonoObject *ret = klass->get_method("GenCoreApiProject", 2)->invoke(NULL, args, &ex);
MonoException *exc = NULL;
MonoObject *ret = klass->get_method("GenCoreApiProject", 2)->invoke(NULL, args, &exc);
if (ex) {
mono_print_unhandled_exception(ex);
if (exc) {
GDMonoUtils::debug_unhandled_exception(exc);
ERR_FAIL_V(String());
}
@@ -68,11 +68,11 @@ String generate_editor_api_project(const String &p_dir, const String &p_core_dll
Variant core_dll_path = p_core_dll_path;
Variant compile_items = p_files;
const Variant *args[3] = { &dir, &core_dll_path, &compile_items };
MonoObject *ex = NULL;
MonoObject *ret = klass->get_method("GenEditorApiProject", 3)->invoke(NULL, args, &ex);
MonoException *exc = NULL;
MonoObject *ret = klass->get_method("GenEditorApiProject", 3)->invoke(NULL, args, &exc);
if (ex) {
mono_print_unhandled_exception(ex);
if (exc) {
GDMonoUtils::debug_unhandled_exception(exc);
ERR_FAIL_V(String());
}
@@ -89,11 +89,11 @@ String generate_game_project(const String &p_dir, const String &p_name, const Ve
Variant name = p_name;
Variant compile_items = p_files;
const Variant *args[3] = { &dir, &name, &compile_items };
MonoObject *ex = NULL;
MonoObject *ret = klass->get_method("GenGameProject", 3)->invoke(NULL, args, &ex);
MonoException *exc = NULL;
MonoObject *ret = klass->get_method("GenGameProject", 3)->invoke(NULL, args, &exc);
if (ex) {
mono_print_unhandled_exception(ex);
if (exc) {
GDMonoUtils::debug_unhandled_exception(exc);
ERR_FAIL_V(String());
}
@@ -110,11 +110,11 @@ void add_item(const String &p_project_path, const String &p_item_type, const Str
Variant item_type = p_item_type;
Variant include = p_include;
const Variant *args[3] = { &project_path, &item_type, &include };
MonoObject *ex = NULL;
klass->get_method("AddItemToProjectChecked", 3)->invoke(NULL, args, &ex);
MonoException *exc = NULL;
klass->get_method("AddItemToProjectChecked", 3)->invoke(NULL, args, &exc);
if (ex) {
mono_print_unhandled_exception(ex);
if (exc) {
GDMonoUtils::debug_unhandled_exception(exc);
ERR_FAIL();
}
}