Hi All,

Carsten Neumann wrote:
>> What I was wondering is does anyone know how we could extend this
>> further?  Perhaps making dereferencing in all the XxxPtr types check
>> that the fc is still valid?
> 
> off hand I don't quite see how to do this. To tell if a container is 
> still valid you need it's id which you can use to query the factory. But 
> to get the id from a container it has to be alive in the first place 
> otherwise you are already operating on a dead object...

I see two options:

- mark FCs as dead on destruction (fill it with 0xdeadbeef or so). When ypu try 
to access it check for that flag value and throw an exception. Assumes that he 
memory is not overwritten by something else before you try to touch it again. 
Probably good enough to catch most cases, but not 100% safe.

- you could check whether the FCs is still registered with the factory before 
derefing it. That should catch everything (as all created FCs are registered 
with the factory and removed on delete), but it will be very expensive to find 
an FC in the factory for each access. Could be sped up by just having an 
stl::set with the active FCs, but would still be expensive.

Real question: why can't you use valgrind? Given that we're not messing around 
with magical pointers and memory offsets any more it should work just fine, and 
pretty much perfect.

Yours

        Dirk

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to