Open RameshRavone opened 4 years ago
I have the same problem. It happened after I updated api.json. I tested around and found out, that the problem is, that the new
function of NativeScript
returns now a Variant
instead of an Object
. The commit that changed that is https://github.com/godotengine/godot/commit/e2121c97ae4e1c0d94eb3caf29118a28a31fdca3. But I'm not sure yet, why it causes a segmentation fault.
The cause of the segmentation fault is, that the reference count hits 0 during the _new()
call. The object gets deleted and a dangling pointer remains.
Thanks @Philius342
Just merged a fix, let me know if that works for you now ;)
As of ~ 9eceb16f0553884094d0f659461649be5d333866 (i.e. after @Zylann's PR) the __internal_constructor()
workaround (mentioned elsewhere) should no longer be necessary and use of it may lead to crash, this should now work correctly:
Ref<CustomClass> ref = Ref<CustomClass>(custom_class_instance);
I've attempting to summarise the current state here: #417
Bare minimum of the file
ai_script.cpp
while
ai_script.h
isAnd when I call
Ref<AIScript> scr = AIScript::_new()
following happens