From: k. h. <kla...@nl...> - 2006-01-11 16:51:59
|
Hi John, John Labenski wrote: > >e) ? > > I hardly understand the problem. I do understand that there are two lua_State at the same time. While there is only one wxLuaState. What would be the problem if there would be two wxLuaStates too? And what would be the solution if the new lua_State became part of every new wxLuaState, and that was passed around using a Smart Pointer to it, instead of the current ref counting mechanism. If several lua_State need to share data, that can be done using a second Smart Pointer inside wxLuaState. It will be cleared properly if all wxLuaStates's are released ( no more smart pointers to it ). I used hierarchies of smart pointers for storing drawing objects, and it works great. I guess what i am trying to say can Smart pointers help here, as a more convenient way to share data. For sure Smart pointer code is much easier to follow in C++ code. What is exactly the reason you choose the current form of ref counting? I do not know how and why wxLua is organized as is yet, so don't get mad if i am talking nonsense ;-) Regards, Klaas -- Unclassified |