From: Lars Magne Ingebrigtsen Date: Sun, 25 Mar 2012 13:38:22 +0000 (+0200) Subject: Fix race condition in url-queue when doing the callback X-Git-Tag: emacs-pretest-24.0.05~59 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e0fe1d55893865df47efceb68551c245f12ceda3;p=emacs.git Fix race condition in url-queue when doing the callback * url-queue.el (url-queue-kill-job): Check whether the buffer has been killed asynchronously before selecting it. --- diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index ff6a6e6f805..d6e25188c69 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,8 @@ +2012-03-25 Lars Magne Ingebrigtsen + + * url-queue.el (url-queue-kill-job): Check whether the buffer has + been killed asynchronously before selecting it. + 2012-03-14 Lars Magne Ingebrigtsen * url-queue.el (url-queue-kill-job): Make sure that the callback diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el index 46124717fed..917c787df29 100644 --- a/lisp/url/url-queue.el +++ b/lisp/url/url-queue.el @@ -160,7 +160,8 @@ The variable `url-queue-timeout' sets a timeout." ;; Call the callback with an error message to ensure that the caller ;; is notified that the job has failed. (with-current-buffer - (if (bufferp (url-queue-buffer job)) + (if (and (bufferp (url-queue-buffer job)) + (buffer-live-p (url-queue-buffer job))) ;; Use the (partially filled) process buffer it it exists. (url-queue-buffer job) ;; If not, just create a new buffer, which will probably be