gui's memory leaks

Will doing something like this give me a memory leak??




well obviously that won’t (ctr S accident) but what about this?

I want to rescale the bones in an armature.
The gui will be generated dynamically from the
bones list. The buttons are held in a dictionnary
which IS global.

The gui seems to work OK but when I replace
the scale placeholder with genuine code it works
OK for 5 or 6 rescalings then it starts to slow
down then a couple more really slow then
I have to kill Blender (OS X)



import Blender


_sk = {'LHand' : ([3.25,0.20,-0.26],[0.13,-1.28,0.06]),
'RRadius' : ([-2.28,1.84,-0.53],[-0.57,-1.88,0.65]),
'Neck' : ([-0.00,4.85,-0.46],[0.00,1.87,-0.13]),
'RFoot' : ([-0.89,-7.97,-0.54],[0.00,-0.30,0.93]),
'LRadius' : ([2.62,2.11,-0.42],[0.63,-1.91,0.16]),
'RClavicle' : ([-0.37,4.68,-0.44],[-0.58,-0.14,-0.00]),
'RTibia' : ([-0.76,-3.57,-0.05],[-0.13,-4.15,-0.44]),
'RHumerus' : ([-0.97,4.53,-0.67],[-1.31,-2.69,0.14]),
'Head' : ([-0.00,6.72,-0.59],[0.00,-0.42,1.11]),
'LFoot' : ([0.79,-7.97,-0.54],[0.00,-0.30,0.93]),
'LTibia' : ([0.66,-3.57,-0.05],[0.13,-4.15,-0.44]),
'LHumerus' : ([1.05,4.42,-0.64],[1.57,-2.30,0.22]),
'LClavicle' : ([0.37,4.68,-0.44],[0.58,-0.24,-0.16]),
'Pelvis' : ([-0.00,0.26,-0.14],[-0.00,1.50,0.20]),
'RHand' : ([-2.85,-0.04,0.12],[-0.21,-1.16,0.52]),
'RFemur' : ([-0.76,0.22,-0.14],[-0.00,-3.79,0.09]),
'Thorax' : ([-0.00,1.76,0.06],[-0.00,2.96,-0.51]),
'LFemur' : ([0.66,0.22,-0.14],[-0.00,-3.79,0.09]) }


def scale(bone,sf = 2.0):
	pass


from Blender.Draw import *
from Blender.BGL import *
     
# Events/Buttons
global buttons

buttons ={}
for i in _sk.keys():	
	BL = Create(1.0)
	buttons[i] = BL
	
def GUI():
	for i,k in enumerate(buttons.keys()):
		buttons[k] =   Slider("%s: "%k, i, 130, 20+20*i, 175, 20, buttons[k].val, 0, 2.0, 0)
	
def Event(evt, val):
	global buttons
	if not val:
		if evt == QKEY:
			Exit()
	if evt == ESCKEY:
		 Exit()


def BEvent(evt):
	global buttons
	if evt < len(buttons.keys()):
		print buttons.keys()[evt],buttons[buttons.keys()[evt]].val
		scale(buttons.keys()[evt],buttons[buttons.keys()[evt]].val)

Register(GUI, Event, BEvent)

Blender.Redraw()