Made event callbacks more rubust: keep an actual reference to the
python callback, and do RemoveEventHandler() upon deallocation.
diff --git a/Mac/Modules/carbonevt/CarbonEvtscan.py b/Mac/Modules/carbonevt/CarbonEvtscan.py
index 856f9b1..e93baf3 100644
--- a/Mac/Modules/carbonevt/CarbonEvtscan.py
+++ b/Mac/Modules/carbonevt/CarbonEvtscan.py
@@ -41,13 +41,14 @@
 		listname = "functions"
 		if arglist:
 			t, n, m = arglist[0]
-			print "*********", t,
 			if t in RefObjectTypes and m == "InMode":
-				print "method"
-				classname = "CarbonEventsMethod"
+				if t == "EventHandlerRef":
+					classname = "EventHandlerRefMethod"
+				else:
+					classname = "CarbonEventsMethod"
 				listname = t + "methods"
-			else:
-				print "not method"
+			#else:
+			#	print "not method"
 		return classname, listname
 
 	def writeinitialdefs(self):
@@ -82,6 +83,7 @@
 
 			# Wrote by hand
 			"InstallEventHandler",
+			"RemoveEventHandler",
 			"RunApplicationEventLoop",
 						
 			# Write by hand?