Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
9c454323
Unverified
Commit
9c454323
authored
May 21, 2019
by
Ignacio Roldán Etcheverry
Committed by
GitHub
May 21, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #29052 from neikeq/fixes-28667------i-think
Replace call to 'mono_runtime_object_init' with manual ctor invoking
parents
ebb6eb8b
66b930a2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
12 deletions
+11
-12
collections_glue.cpp
modules/mono/glue/collections_glue.cpp
+2
-2
gd_mono_utils.cpp
modules/mono/mono_gd/gd_mono_utils.cpp
+8
-9
gd_mono_utils.h
modules/mono/mono_gd/gd_mono_utils.h
+1
-1
No files found.
modules/mono/glue/collections_glue.cpp
View file @
9c454323
...
...
@@ -162,7 +162,7 @@ MonoObject *godot_icall_Dictionary_GetValue(Dictionary *ptr, MonoObject *key) {
#ifdef DEBUG_ENABLED
CRASH_COND
(
!
exc
);
#endif
GDMonoUtils
::
runtime_object_init
(
exc
);
GDMonoUtils
::
runtime_object_init
(
exc
,
CACHED_CLASS
(
KeyNotFoundException
)
);
GDMonoUtils
::
set_pending_exception
((
MonoException
*
)
exc
);
return
NULL
;
}
...
...
@@ -176,7 +176,7 @@ MonoObject *godot_icall_Dictionary_GetValue_Generic(Dictionary *ptr, MonoObject
#ifdef DEBUG_ENABLED
CRASH_COND
(
!
exc
);
#endif
GDMonoUtils
::
runtime_object_init
(
exc
);
GDMonoUtils
::
runtime_object_init
(
exc
,
CACHED_CLASS
(
KeyNotFoundException
)
);
GDMonoUtils
::
set_pending_exception
((
MonoException
*
)
exc
);
return
NULL
;
}
...
...
modules/mono/mono_gd/gd_mono_utils.cpp
View file @
9c454323
...
...
@@ -300,7 +300,7 @@ void update_godot_api_cache() {
// TODO Move to CSharpLanguage::init() and do handle disposal
MonoObject
*
task_scheduler
=
mono_object_new
(
SCRIPTS_DOMAIN
,
GODOT_API_CLASS
(
GodotTaskScheduler
)
->
get_mono_ptr
());
GDMonoUtils
::
runtime_object_init
(
task_scheduler
);
GDMonoUtils
::
runtime_object_init
(
task_scheduler
,
GODOT_API_CLASS
(
GodotTaskScheduler
)
);
mono_cache
.
task_scheduler_handle
=
MonoGCHandle
::
create_strong
(
task_scheduler
);
mono_cache
.
godot_api_cache_updated
=
true
;
...
...
@@ -401,11 +401,10 @@ MonoThread *get_current_thread() {
return
mono_thread_current
();
}
void
runtime_object_init
(
MonoObject
*
p_this_obj
)
{
GD_MONO_BEGIN_RUNTIME_INVOKE
;
// FIXME: Do not use mono_runtime_object_init, it aborts if an exception is thrown
mono_runtime_object_init
(
p_this_obj
);
GD_MONO_END_RUNTIME_INVOKE
;
void
runtime_object_init
(
MonoObject
*
p_this_obj
,
GDMonoClass
*
p_class
,
MonoException
**
r_exc
)
{
GDMonoMethod
*
ctor
=
p_class
->
get_method
(
".ctor"
,
0
);
ERR_FAIL_NULL
(
ctor
);
ctor
->
invoke_raw
(
p_this_obj
,
NULL
,
r_exc
);
}
GDMonoClass
*
get_object_class
(
MonoObject
*
p_object
)
{
...
...
@@ -467,7 +466,7 @@ MonoObject *create_managed_for_godot_object(GDMonoClass *p_class, const StringNa
CACHED_FIELD
(
GodotObject
,
ptr
)
->
set_value_raw
(
mono_object
,
p_object
);
// Construct
GDMonoUtils
::
runtime_object_init
(
mono_object
);
GDMonoUtils
::
runtime_object_init
(
mono_object
,
p_class
);
return
mono_object
;
}
...
...
@@ -477,7 +476,7 @@ MonoObject *create_managed_from(const NodePath &p_from) {
ERR_FAIL_NULL_V
(
mono_object
,
NULL
);
// Construct
GDMonoUtils
::
runtime_object_init
(
mono_object
);
GDMonoUtils
::
runtime_object_init
(
mono_object
,
CACHED_CLASS
(
NodePath
)
);
CACHED_FIELD
(
NodePath
,
ptr
)
->
set_value_raw
(
mono_object
,
memnew
(
NodePath
(
p_from
)));
...
...
@@ -489,7 +488,7 @@ MonoObject *create_managed_from(const RID &p_from) {
ERR_FAIL_NULL_V
(
mono_object
,
NULL
);
// Construct
GDMonoUtils
::
runtime_object_init
(
mono_object
);
GDMonoUtils
::
runtime_object_init
(
mono_object
,
CACHED_CLASS
(
RID
)
);
CACHED_FIELD
(
RID
,
ptr
)
->
set_value_raw
(
mono_object
,
memnew
(
RID
(
p_from
)));
...
...
modules/mono/mono_gd/gd_mono_utils.h
View file @
9c454323
...
...
@@ -249,7 +249,7 @@ _FORCE_INLINE_ bool is_main_thread() {
return
mono_domain_get
()
!=
NULL
&&
mono_thread_get_main
()
==
mono_thread_current
();
}
void
runtime_object_init
(
MonoObject
*
p_this_obj
);
void
runtime_object_init
(
MonoObject
*
p_this_obj
,
GDMonoClass
*
p_class
,
MonoException
**
r_exc
=
NULL
);
GDMonoClass
*
get_object_class
(
MonoObject
*
p_object
);
GDMonoClass
*
type_get_proxy_class
(
const
StringName
&
p_type
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment