Rich text editor: 	get rid of global variable. Fix memory leak.