the error appears right after the
D3DXCreateBox(m_pd3dDevice,1,1,1, thefbox.Themesh,nil);

the class that represents thefbox is:

type

TMyD3DMesh = class
TheMesh : ID3DXMesh;
TheMatrix : TD3DXMatrix;
end;

var thefbox : TMyD3DMesh;

where is the error?
well i cant see it cous when i create a box this way:
D3DXCreateBox(m_pd3dDevice,1,1,1 , fBox,nil);
there is no error but when i try to use the class i get the non-zero reference count
why is that?