[Bf-committers] Klocwork source analysis

Joe Eagar joeedh at gmail.com
Sun Dec 3 03:43:04 CET 2006


Stephen Swaney wrote:
> On Sat, Dec 02, 2006 at 05:01:40PM -0700, Joe Eagar wrote:
>
>   
>> Well I don't see the point of doing a NULL check there; it seems as 
>> pointless as checking for NULL after alloc functions.
>>     
>
> Why?
>
> - because defererencing a null pointer will crash Blender without
> warning.
>
> - because Python uses its own memory pool for allocation.
>
> - because checking and emitting a console msg gives a clue
> to what is happening.
>
> - because dereferencing a null pointer is generally regarded
> as a lame programming error.
>
> - because Ton laughs at us when BPy crashes Blender.
>
> - because it is rude to leave abruptly without saying goodbye.
>
> Take your pick.
>   

Why would PyObject_New fail though? I don't get it, that seems as likely 
as MEM_callocN failing.

Joe


More information about the Bf-committers mailing list