GC cannot free an object of type '_builtin_objecttype_'

This topic is 2559 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Revision 1072.
After loading scripts from source and releasing engine it gives this errors:
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.
[34:249] Script message: : Error : GC cannot free an object of type '_builtin_objecttype_'. Make sure all types that can form circular references have the GC behaviours : 0, 0.[/quote]
This is from ReportUndestroyedObjects().

Share on other sites
This doesn't happen in any of my tests. Can you provide a scenario that I can use to reproduce the problem?

Share on other sites
This code give error
class T { }; array<T> arr;

Share on other sites
Strange, this script doesn't cause me any problem.

Are you using revision 1073? (you mention 1072 above, but I already fixed the other bug you found related to the script array in 1073)

Do you use any custom settings, e.g. asEP_ALLOW_UNSAFE_REFERENCES, or perhaps some customizations on the library or add-ons?

Share on other sites
On revision 1073 same.

asEP_ALLOW_UNSAFE_REFERENCES true
asEP_OPTIMIZE_BYTECODE true
asEP_SCRIPT_SCANNER 0
asEP_AUTO_GARBAGE_COLLECT false
asEP_ALWAYS_IMPL_DEFAULT_CONSTRUCT true
Others by default.

I have custom things for some addons, i try inspect it now, maybe something wrong with hand-made merging.

Share on other sites
And as i say before - after loading from bytecode this errors not showing.

Share on other sites
I thought your setting [color=#1C2837][size=2]asEP_ALWAYS_IMPL_DEFAULT_CONSTRUCT[color=#1C2837][size=2] may have been what is different, but no, even when setting the same configurations I still cannot reproduce the problem.
I'm definitely not discarding that this is a bug in AngelScript, especially since you say you don't have the problem when loading from precompiled bytecode, but without being able to reproduce it myself it is very hard to imagine where the problem may be.

My test looks like this:

[source]

{

asIScriptEngine *engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
engine->SetEngineProperty(asEP_ALWAYS_IMPL_DEFAULT_CONSTRUCT, true);
engine->SetEngineProperty(asEP_ALLOW_UNSAFE_REFERENCES, true);
engine->SetEngineProperty(asEP_OPTIMIZE_BYTECODE, true);
engine->SetEngineProperty(asEP_SCRIPT_SCANNER, 0);
engine->SetEngineProperty(asEP_AUTO_GARBAGE_COLLECT, false);
engine->SetEngineProperty(asEP_ALWAYS_IMPL_DEFAULT_CONSTRUCT, true);
engine->SetMessageCallback(asMETHOD(COutStream, Callback), &out, asCALL_THISCALL);
RegisterScriptArray(engine, true);
engine->RegisterGlobalFunction("void assert(bool)", asFUNCTION(Assert), asCALL_GENERIC);

const char *script =
"class T {} \n"
"array<T> arr; \n";

asIScriptModule *mod = engine->GetModule(0, asGM_ALWAYS_CREATE);
r = mod->Build();
if( r < 0 )
TEST_FAILED;

r = ExecuteString(engine, "array<T> a; a.insertLast(T()); a.resize(2);", mod);
if( r != asEXECUTION_FINISHED )
TEST_FAILED;

engine->Release();
}
[/source]

Share on other sites
Sorry, this is my fail, i Release object returned by GetObjectTypeById.

Share on other sites
No problem, i'm just glad you found the cause

1. 1
2. 2
3. 3
Rutin
19
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• Forum Statistics

• Total Topics
633659
• Total Posts
3013210
×