Hi John,

I think i found the problem, it seems one can have not two pointers to 
the same location.
The base class of  MaskprocLuaWrapper has the pointer down here called  
a2dLuaWP.
It has of course the same value as the pointer in the derived class. But 
in the derived class it is called a2dMaskProc.
No if i outcoment the first %define_pointer a2dLuaWP, all is fine. But 
if not i get the assertion.

And i  think  the assertion at this spot is not a coincidence,  if i 
look at the name.

luaO_rawequalObj(const lua_TValue * 0x4d678191, const lua_TValue * 0x02005698) 
line 73 + 6 bytes

Still this should not be a problem (at least if %delete means what i thought it 
meant).
Maybe to make this work properly we need some smart pointer??

So in short i have a global pointer to a command interpreter in a library, and 
in my application the derived class has a global pointer to the same (but 
derived class).
And both those pointer i like to wrap.

What do you think?

Klaas


//-------------------- first binding module
luabind.i file

%class %delete %noclassinfo a2dLuaWrapper, a2dCommandLanguageWrapper
    //%define_pointer a2dLuaWP
    a2dLuaWrapper( a2dCentralCanvasCommandProcessor* commandProcessor )
...........................
%endclass

//-------------------- second binding module
maskproc.i

%class %delete %noclassinfo MaskprocLuaWrapper, a2dLuaWrapper
    MaskprocLuaWrapper( a2dCentralEditorCommandProcessor* 
commandProcessor )  
    bool Exit() 
   
    %define_pointer a2dMaskProc
   
%endclass


John Labenski wrote:
> On Dec 21, 2007 10:31 AM, Klaas Holwerda <[EMAIL PROTECTED]> wrote:
>   
>> If i remove "%define_pointer a2dMaskProc", the RegisterBindings() fase is 
>> fine.
>> The function a2dGetMaskProc() return the same pointer, and i tested a few 
>> script
>>     


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to