[Deskbar] more async stopping cleanups



While writting a Live Beagle handler I discovered that async handlers'
clean up functions are not called on QueryStop exceptions.

This patch fixes that. It is against clean cvs. It applies fine together
with my last async clean up patch also.

Cheers
Mikkel
diff -ruN ../deskbar-applet/deskbar/handler.py deskbar/handler.py
--- ../deskbar-applet/deskbar/handler.py	2005-10-17 18:49:44.000000000 +0200
+++ deskbar/handler.py	2005-10-18 16:13:06.344712720 +0200
@@ -249,7 +249,16 @@
 		If you pass a timeout argument this call will not return before the query
 		has been unchanged for timeout seconds.
 		"""
-		qstring = self.__get_last_query (timeout)
+		qstring = None
+		try:
+			qstring = self.__get_last_query (timeout)
+		except QueryStopped:
+			if clean_up:
+				if args == NoArgs:
+					clean_up ()
+				else:
+					clean_up (args)
+			raise QueryStopped()
 		if qstring:
 			# There's a query queued
 			# cancel the current query.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]