From: John L. <jla...@gm...> - 2006-06-09 03:59:06
|
On 6/8/06, Steve Kieu <ha...@ya...> wrote: > > Still the combination: my exe ; a sqlite3 module loaded, and a relatively > > big table with strings or similar will gives wxLua Memory allocation > error. > > Hummm, you mean a lua table created and used in lua? No ideas... > > Yeah the lua table, created and used in lua. Very strange indeed, it gives > error even before running it; Lets say: > > 1 Load sqlite3 and init stuff > 2. wx.wxMessageDialod("Check to see if it reaches here") > 3. local sql_strs={} > 4. many table.insert(sql_strs, "sql string here") > 6. even not do anything with table here, just end script > > Run the file, got error, line 2. not reached. What is the error exactly? The memory allocation something or other? > If comment out 4 no error. If not load the sqlite3 modules no error. > > of course the solution is easy, just put a text file each line has a sql > command and iterate io.lines() on it ; it works. But you know it is one > example of correct usage Try using wxLuaFreeze and require for the sqlite3 module and your code. Does this fail? > Another case that it gives error is the following simple echo server > > local socket=require"socket" local copas=require"copas" local host = host > or "localhost" local port = port or 8080 if arg then host = arg[1] or host > port = arg[2] or port end > local function handle_server(skt) skt=copas.wrap(skt) table.foreach > (skt,print) -- If client do not send quit command it will loop forever :-) > while true do -- local line, err = copas.receive(skt) local line, > err=skt:receive() print(line, err) if line=="quit" then break end end end > print("Binding to host '" ..host.. "' and port " ..port.. "...\n") > local server = assert(socket.bind(host, port)) local i, p = > server:getsockname() assert(i, p) print(i, p,"\n") copas.addserver(server, > handle_server) copas.loop() > Last night I have removed all custom bindings but in the exe one still have > two wxLuaState one in main thread, the other is in a another thread to run a > log.lua to process log that wxLuaEvent sends (I like that way); this time > the simpler server works but the script using sqlite3 still failled. I'm guessing the sqlite3 module has problems then. > About the picker, I just add a quick code to use it so it is not concrete > yet at least I think, it does not check conditions wxLuaUseXXX etc.. Ok, I'll probably wait until I get a new wxWidgets checkout and add them all then. -John Labenski |