Problem with V3d_Light::SetColor()

Hello,

I'm just trying to define a V3d_Light in order to use it with a V3d_Viewer.

Handle(V3d_Light) myLight;
myLight->SetColor(Quantity_NOC_WHITE);

The SetColor results in a segmentation fault, gdb returns :

Program received signal SIGSEGV, Segmentation fault.
0xb4faaacc in V3d_Light::SetColor (this=0xfefd0000, aColor=@0xfefd0000) at ../../../inc/Handle_Visual3d_Light.hxx:78
78 {

Am i doing something wrong ?

Jan Brüninghaus's picture

Handle(V3d_Light) myLight; <-- that gives you a pointer, but not an object
myLight->SetColor(Quantity_NOC_WHITE); <-- since myLight references no object, you get a segfault

Etienne Lorriaux's picture

Thanks Jan.