Browse files

avoid race in device-close [bug20559]

	modified:   deflate.cl
  device-close: call to free-deflate-buffer-resource should be
    after all uses are done
  • Loading branch information...
1 parent eb080e2 commit 3811035855435644d68d0da9c25129f3fa2ae16c mm committed Oct 26, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 deflate.cl
View
7 deflate.cl
@@ -484,15 +484,18 @@ actual error:~% ~a" c)))
then ; flush all current data
(finish-zlib-compression p))
- (free-deflate-buffer-resource (zlib-static-resources p))
-
(let ((z-stream (zlib-z-stream p)))
(if* (not (zerop z-stream))
then (finish-z-stream z-stream))
(setf (zlib-z-stream p) 0))
(if* (deflate-target-stream p)
then (force-output (deflate-target-stream p)))
+
+ ;; Free the Lisp resource only after all the uses of
+ ;; the static areas are done. [bug20559]
+ (free-deflate-buffer-resource (zlib-static-resources p))
+
p
)

0 comments on commit 3811035

Please sign in to comment.