Jump to content
  • Advertisement
Sign in to follow this  
cvet

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.

If you intended to correct an error in the post then please contact us.

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().
Loading from bytecode don't give this errors.

Share this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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);
mod->AddScriptSection("script", script);
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 this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!