← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] S3D Mesh Smart Pointer

 

On 14 April 2015 at 09:17, Mário Luzeiro <mrluzeiro@xxxxx> wrote:
> Hi Mark,
>
> No problem, I didn't know how it works but now I understand it.
>
> I was thinking that they have some documentation or rules /guides like the MISRA C/C++
> http://www.misra-cpp.com
> http://en.wikipedia.org/wiki/MISRA_C
>
> They describe all the rules with examples and cases (the original documents are not free :/ )
> http://archive.redlizards.com/docs/misrac++2008-datasheet.pdf
>
> Maybe Coverity is following similar rules.. (they are all good practice rules anyway)

I think the great thing about Coverity is that it's not rules-based.
It's just an information service that's able to inform you of
potential problems in your code.

The root cause of this problem was deleting an object without
re-assigning the pointer to that object to NULL. We could have fixed
the problem by immediately setting the pointer to NULL after each
place it is deleted and not re-assigned a value. However, it was
decided on-list to move to a smart pointer instead.

It's worth looking at the documentation for the smart pointer used:
http://www.boost.org/doc/libs/1_57_0/libs/smart_ptr/shared_ptr.htm

The last thing I want to do is make your life harder by confusing you,
so please carry on asking questions if it still doesn't make sense for
you. The 3D viewer has come a long way in other people's hands, it's
not for me to mess that work up!!

Best Regards,

Brian.


Follow ups

References