On Mon, Mar 23, 2009 at 3:11 PM, Dirk Reiners <[email protected]> wrote: > > 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.
That sounds pretty good. That is what the current memory debugging code is *supposed* to do, but I am not sure it is low-level enough and tracks everything we need to. I was hoping that you, Carsten, or GV could let us know exactly what underlying places to target for debugging. (ie. which pointers to set to xdeadbeef.) > - 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. True. It would be expensive. Just trying to find a good way to debug issues like this when we get to them. > 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. That is a good question. The first answer is because we are having the problem on windows. The second is that I didn't know it would work now. :) -Allen > > 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 > ------------------------------------------------------------------------------ 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
