this is my code:

Code:
import graphics, appuifw, e32,time,os,thread,sys

class app():

	def __init__(self):
		app_lock = e32.Ao_lock()
		appuifw.app.exit_key_handler = quit

		self.l = thread.allocate_lock()
		scr= u"e:\\data\\python\\about.png"
		self.img = graphics.Image.open(scr)
		self.img.text((20, 45), u"Image editing", font="title")
 
		#Show the result on the screen
		self.canvas = appuifw.Canvas(redraw_callback=self.handle_redraw)
		self.canvas.blit(self.img)
		appuifw.app.body = self.canvas
 
	def quit(self):
		app_lock.signal()
		
	def handle_redraw(self,rect):
		self.canvas.blit(self.img)

	def a1(self):
		try:
			time.sleep(2)
			self.l.acquire()
			self.img.rectangle((30,45,110,100), fill=0x000000)
			self.canvas.blit(self.img)
			self.l.release()
		except:
			print "error:", sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2]

if __name__ == '__main__':
	d = app()
	thread.start_new_thread(d.a1, ())
	
#app_lock.wait()
when i run it, python crashes.... cant figure out whats wrong...