Reference Counting Proxy invalid 0xFFFFFFFFF pointers.

10 views
Skip to first unread message

Christopher Sosa

unread,
Apr 19, 2016, 2:39:09 PM4/19/16
to Helium Project
So finally i got importants parts of Helium working properly, i faced some issues about Reference counting part of Reflect, the Proxy object of the managed object crash because the proxy pointer has an address of 0xFFFFFFFFF, everytime you want to assign to another pointer of that object.

Entity* entity = GetSlice()->CreateEntity(definition);

This works fine but in another class when i try to assign that entity to another from another class like this

m_Entity = entity;

it crash into that line

    RefCountProxy< BaseT >* pProxy = m_pProxy;

Foundation/ReferenceCounting.inl line 155

Geoff Evans

unread,
Apr 21, 2016, 11:22:18 AM4/21/16
to helium...@googlegroups.com
Have you tried taking the result of CreateEntity into a StrongPtr?

I have the recollection that some of the APIs in the entity/definition system was using bare pointers when it should be using refcounted StrongPtr<>.  I think in the codebase its usually good form to take allocation results into local or member SmartPtr/StrongPtr so you can’t accidentally leak it.

--
You received this message because you are subscribed to the Google Groups "Helium Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to heliumprojec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher Sosa

unread,
Apr 25, 2016, 1:22:57 PM4/25/16
to Helium Project
I'm sorry but already solved it, somehow my class where i was creating the EntityPtr was using Reflect::Object (with no reflect macros) but i removed the inheritance and everything works properly again, the only drawback is i have to free the memory locally, but i can manage, but that tip would become useful later, thanks!
Reply all
Reply to author
Forward
0 new messages