[Bf-python] Memory bug in Bpy api

Ken Hughes khughes at pacific.edu
Sun Jan 22 18:09:18 CET 2006


OK, I've cut the code in ShaderEditorGUI.py down to 35 lines, completely 
eliminating all modules except Blender.Draw, and I can still get the 
crashs when exiting the script.  It is very "twitchy" though; adding or 
removing some seemingly unrelated code can make the bug disappear.

Ken

Bobby Parker wrote:
> The majority of them aren't defined anywhere, it's just placeholder at 
> the moment. The only ones that currently work are shader_draw, 
> shader_event, and shader_bevent in the file ShaderEditorGUI.py
> 
> The script callbacks that are being loaded, are imported from 
> btor.ShaderEditorGUI.
> 
> Bobby
> 
> On 1/22/06, *Ken Hughes* <khughes at pacific.edu 
> <mailto:khughes at pacific.edu>> wrote:
> 
>     Bobby Parker wrote:
>      > Hi,
>      > I'm developing a script using the Python API, and I think I've
>     found a
>      > nice memory bug.
> 
>     Ok, I was finally able to get cgkit and aqsis installed, but wasn't able
>     to follow your instructions for setting up BtoR.py.  I did put it in its
>     own directory, modified BtoR.py to append that dir to sys.path so
>     subsequent imports would find the other modules, and ran the script.  I
>     got somewhat different results probably because of this.
> 
>     1) with no reload removed, I get an error on the first script execution
>     inside the first call to master_gui(), when shader_draw() is called.  It
>     dies in PyObject_Malloc.
>     2) if I remove all the reloads except reload( btor.ShaderEditorGui), I
>     can run the script, kill with ESC, about 4 times, then get an error in
>     PyObject_GC_UnTrack() called from PyDict_Clear() in BPY_clear_script().
>       This is where the script global dict is cleared.
>     3) if I remove all the reloads, everything works
>     4) if I just put a "return" in master_gui(), thing work OK for the
>     scripts in 1) and 2).
> 
>     So it is related to the script callbacks executing and the reloads.
> 
>     BTW, where the heck are the functions in master_gui() defined?
> 
>     Ken




More information about the Bf-python mailing list