emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/xelb 36b54b4 1/2: Handle nonlocal exits when calling ev


From: Chris Feng
Subject: [elpa] externals/xelb 36b54b4 1/2: Handle nonlocal exits when calling event handlers
Date: Wed, 28 Oct 2015 10:59:27 +0000

branch: externals/xelb
commit 36b54b44987c2b05e0a78f7783373e977d706489
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    Handle nonlocal exits when calling event handlers
    
    * xcb.el (xcb:-connection-filter): Do cleanups from nonlocal exits.
---
 xcb.el |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/xcb.el b/xcb.el
index 68d4b8d..6b1b9e6 100644
--- a/xcb.el
+++ b/xcb.el
@@ -310,14 +310,15 @@ Concurrency is disabled as it breaks the orders of 
errors, replies and events."
       (with-slots (event-lock event-queue) connection
         (unless (< 0 event-lock)
           (cl-incf event-lock)
-          (let (event data synthetic)
-            (while (setq event (pop event-queue))
-              (setq data (aref event 1)
-                    synthetic (aref event 2))
-              (dolist (listener (aref event 0))
-                (with-demoted-errors "[XELB ERROR] %S"
-                  (funcall listener data synthetic)))))
-          (cl-decf event-lock))))))
+          (unwind-protect
+              (let (event data synthetic)
+                (while (setq event (pop event-queue))
+                  (setq data (aref event 1)
+                        synthetic (aref event 2))
+                  (dolist (listener (aref event 0))
+                    (with-demoted-errors "[XELB ERROR] %S"
+                      (funcall listener data synthetic)))))
+            (cl-decf event-lock)))))))
 
 (cl-defmethod xcb:disconnect ((obj xcb:connection))
   "Disconnect from X server."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]