Menu

About null parameter

Help
2007-07-02
2013-04-25
  • zhanglinsjtu

    zhanglinsjtu - 2007-07-02

    Hi Admin,

    I found that some wrapped functions cannot process "null" parameter well. For example:

    void vtkInteractorStyle::HighlightProp3D(vtkProp3D^ prop3D)
    {
    ::vtkProp3D* prop3DWrap = vtk::ConvertManagedToNative<::vtkProp3D>(prop3D->GetNativePointer());
    vtk::ConvertManagedToNative<::vtkInteractorStyle>(m_instance)->HighlightProp3D(prop3DWrap);
    }

    I you pass a null value to "prop3D", the function will be crashed just because the "GetNativePointer" should have an object owner.

    But the original(unwrapped) vtkInteractorStyle::HighlightProp3D function can process NULL value quite well.

    Do you think so?

    Best Regards,
    Lin Zhang

     
    • Andrew Dolgert

      Andrew Dolgert - 2007-07-02

      It seems to me that you are correct. You point it out very nicely. I need to update the toolkit, anyway, and this would be a simple fix to check for a null pointer. Thank you very much for your help.

      - Drew

       

Log in to post a comment.