Re: Crash in wrapper_base.cpp

Drew McLean <[email protected]> Fri, 8 Jul 2011 12:22:59 -0700
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <CAGo0s8NNAQ+RbtUpvGuLaAeLFqNb4erT=S5vYcQgg8sq2xO+TQ@mail.gmail.com>
Hmmm, I tried running your sample code and I seem to be getting the same
results each time.  What lines did you modify between tests?

I tried removing "  v[obj] = obj\n" and "  v[a[i]] = nil\n" for the run that
doesn't use keys as indices.

Seems like using an object as a key is perfectly ok.

>From http://www.lua.org/pil/17.2.html:

     *Once we use an object as a key in a table, we lock the object into
existence. Lua cannot collect an object that is being used as a key*


    Drew


On Thu, Jul 7, 2011 at 11:36 PM, Nigel Atkinson <[email protected]>wrote:

> On Fri, 2011-07-08 at 09:44 +1000, Nigel Atkinson wrote:
> > On Thu, 2011-07-07 at 11:44 -0700, Drew McLean wrote:
> > > I don't think that's the case since I'm printing at the point where I
> > > unregister an object (in a common function).  And there is no loop
> > > where I release a bunch at once, they each complete in their own time.
> > > My global table uses the object as the key and the value.  Is there
> > > something wrong with that?  I can't see why.
> > >
> > >    Drew
> > I can not think of any reason why using the object as a key would not
> > work either.
>
>
> I made a test program and it worked as expected until I added using the
> objects as keys in a table. :-/
>
> Next question is 'why?'.  However it's Friday and nearly time to go to
> the pub.
>
> Attached is my test program - it requires changing line 66 in
> wrapper_base.hpp from private to protected, so it can print an error
> rather than asserting.
>
> Nigel
>
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> luabind-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/luabind-user
>
>


-- 
Drew McLean
Lead Tech Programmer
A Priori Games
(250) 508-3346
www.apriorigames.com

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user