-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't serialise Slot => infinite loop #14
Comments
This should fix the circular reference issue: |
You probably don't want to serialise added listeners anyway, right? |
yes the USE_CACHE set to true fixed the issue. Thanks. |
"You probably don't want to serialise added listeners anyway, right?" |
But there's no way you can serialise the listeners anyway, it would be impossible to restore references to the listener closures. Apologies, but this is a rather specific edge case, and given it can be solved in the serialiser adding custom a hxSerialise method seems like overkill (everyone will get that code unless they're using full dce) |
Sorry but i don't agree. It's annoying, because it is a crash of compilation, without clear I don't understand, why it is overkill to add only one function. Its is Le 29/01/2015 16:18, David Peek a écrit :
|
Le 29/01/2015 16:18, David Peek a écrit :
|
Hey @sebpatu . I wrote an entity system where entities have two signals each, but I don't serialize them intentionally, as all of the observers don't need to be serialized. Do you have a use-case you need help on? |
Hi,
A Signal, and therefore a Solt, is serialisable only when no listener has been added.
If you add a listener you get two issues, at least on flash9 target:
Solution: would be to implement custom hxSerialise and hxUnserialise functions for a Slot class to handle signal field differently.
When i use a serialiser that override serializeClassFields to avoid the serialisation of fields that are Functions, it fixes the issue. i add this line in the loop:
if (Type.typeof(Reflect.field(v, f)) == TFunction) continue;
just before
serializeString(f);
serialize(Reflect.field(v,f));
I think its more a problem for haxe compiler and Serialiser then mSignal, but you need to fix it to get the first issue of infinit loop that is more a mSignal issue.
Thanks
The text was updated successfully, but these errors were encountered: