lua-users home
lua-l archive

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


hi. i'm trying to make something like this. i have a main application and a lot 
of dlls. i made my own load dll function and i load all dlls using LoadLibrary 
into my main app. then i get from each of this dll a function, using 
GetProcAddress. then i run all this functions, their only parameter is a 
lua_State pointer i've created in my main application as a global variable. in 
those functions i'm registering other functions into lua state. the problem is 
that when i'm doing it i get an error (a heap error). from the debuger i saw 
that the error is produced by luaM_realloc, wich calls free(). so i guess is 
because lua tries to delete something allocated in the app from the dll. so 
i've identified the problem, but i need a solution to. as i didn't build lua 
libs from the sources(but i got them too) i use the binaries provided from 
lua.org. i've saw over www a method to solve, by modifing luaM_realloc with 
some global allocation functions. is there any other solve, or i have to do it 
myself too, wich it doesn't sound like a good idea, cause it has some trad-offs 
too. please help.thanks

mihai



______________________________________________________________________
Do you want a free e-mail for life ? Get it at http://www.personal.ro/