Hi Yücel,

On Mon, 2006-03-06 at 21:29 +0100, Yücel Ahi wrote:
> 
> Yes, it really makes little sense, but i can reproduce the problem with
> the example code that you provided (using Qt-4.1.1 again). Again no
> problem when i derive from QObject or another class which is not
> derived from Qwidget, but fails if i use QWidget.
> 
> I stepped through the code in the debugger and found the following problem
> which might be a hint for you (it's not one for me :)) ):
> 
> In method osgTypedMethodFunctor1ObjPtrCPtrRef() [file osgtypedfunctors.inl]
> the OFunctor "returnValue" gets initialized by calling the method
> setMethod()
> (so returnValue.setMethod()):
> 
> template <class Parent, class Params> inline
> void TypedStoredObjectFunctorBase<Parent, Params>::setMethod(ObjMethodF
> pFunc)
> {
>     Self::_flags |=  Self::FuncPtrValid;
> 
>     *((ObjMethodF *) Self::_data2) = pFunc; 
> }
> 
> The assignment of pFunc to _data2 "overwrites" the other member variables
> like the just set _flags member variable. Before the assignment the _flags
> variable has a value of 0x02 and after the assignment it has a value of
> 0x00.
> 
> When afterwards the TypedStoredObjectFunctor1 method is invoked, it tests
> the FuncPtrValid-Flag which has been cleared by the assignment and does not
> invoke the methode.
> 
> if(Self::_flags & Self::FuncPtrValid &&
>    Self::_flags & Self::ObjectValid)
> {
>    //NEVER REACHES THIS ONE
>    return TypeTraits::callObjectMethod(Self::_data1, Self::_data2, obj);
> }
> else
> {
>    //BUT THIS INSTEAD
>    return RetT();
> }
> 
> Any idea what the problem might be ? Unfortunately i have no Linux box
> available right now, so that i can double check the problem with linux
> and gcc.

Ack! I thought we had finally nicked all bugs in that part. :(

Ah well, 2.0 will use boost::function to avoid all those issue, but for
now you can try to increase the buffer space by changing
_uiFuncPointerSize in OSGFunctorBase.h to

_uiFuncPointerSize = osgStaticMax<sizeof(FuncPointerT),
                                          sizeof(InstanceFuncPointerT)
>::iMax * 2,

This is brute force but worth a quick try. You will probably have to
recompile the lib, though. :(

Hope it helps

        Dirk




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to