lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thanks for replying, Ignacio.  You actually solved my problem by making me look at my code again.  I was getting ready to send you my code when I noticed that I had:

int lua_testlibopen (lua_State *L) {
	
	luaL_reg tab_funcs[] = {
		{"SayHi", testlib_sayhi},
		{"GetName", testlib_getname},
		{NULL, NULL}
	};

	luaL_openlib(L, "Test", tab_funcs, 1);
	return 0;
}

notice that the line "luaL_openlib(L, "Test", tab_funcs, 1);" has the number 1 at the end when I really don't have any upvalues.  When I changed it to 0, it workes OK.  Your comment about userdatas gave me a hint.  THANK YOU to all of you that helped with this problem.  I was probably not going to be able to sleep tonight if I didn't get this figured out.  I would offer you my first-born, but he is a cute kid and I like him too much.  How about a Canadian beer if you ever come by... :)

- Brett

> -----Original Message-----
> From: Ignacio Castaño [mailto:castanyo@yahoo.es]
> Sent: Thursday, March 06, 2003 2:09 PM
> To: Multiple recipients of list
> Subject: Re: Lua 5.0 beta/loadmodule question
> 
> 
> Brett Kapilik wrote:
> > Again, let me re-iterate that I never have any problems if 
> I don't call
> "module.load" from loadmodule.c.  If I do call it, the loaded 
> module works
> as expected but then I get the crash at the end.  Any 
> additional insights
> would be fantastic.
> 
> Hi Brett,
> 
> which modules are you using?
> do the modules create any userdatas? do those userdatas have 
> a gc method?
> 
> could you verify that the module is not being unloaded before 
> calling the gc
> method of your objects?
> 
> 
> 
> Ignacio Castaño
> castanyo@yahoo.es
> 
> 
> ___________________________________________________
> Yahoo! Móviles
> Personaliza tu móvil con tu logo y melodía favorito 
> en http://moviles.yahoo.es
> 
>