Skip to content

Commit

Permalink
Deallocate resource IDs when freeing up things
Browse files Browse the repository at this point in the history
  • Loading branch information
l04m33 committed Jul 25, 2016
1 parent 5dc2fa8 commit 5f25dff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 4 additions & 2 deletions extensions/xrender.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -525,13 +525,15 @@ by every function, which attempts to generate RENDER requests."
(let ((display (picture-display picture)))
(with-buffer-request (display (extension-opcode display "RENDER"))
(data +X-RenderFreePicture+)
(picture picture))))
(picture picture))
(deallocate-resource-id display (picture-id picture) 'picture)))

(defun render-free-glyph-set (glyph-set)
(let ((display (glyph-set-display glyph-set)))
(with-buffer-request (display (extension-opcode display "RENDER"))
(data +X-RenderFreeGlyphSet+)
(glyph-set glyph-set))))
(glyph-set glyph-set))
(deallocate-resource-id display (glyph-set-id glyph-set) 'glyph-set)))

(defun render-query-version (display)
(with-buffer-request-and-reply (display (extension-opcode display "RENDER") nil)
Expand Down
3 changes: 2 additions & 1 deletion fonts.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@
(setf (display-font-cache display) (delete font (display-font-cache display)))
;; Close the font
(with-buffer-request (display +x-closefont+)
(resource-id id)))))
(resource-id id))
(deallocate-resource-id display id 'font))))

(defun list-font-names (display pattern &key (max-fonts 65535) (result-type 'list))
(declare (type display display)
Expand Down
6 changes: 4 additions & 2 deletions requests.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@

(defun destroy-window (window)
(declare (type window window))
(with-buffer-request ((window-display window) +x-destroywindow+)
(window window)))
(let ((display (window-display window)))
(with-buffer-request (display +x-destroywindow+)
(window window))
(deallocate-resource-id display (window-id window) 'window)))

(defun destroy-subwindows (window)
(declare (type window window))
Expand Down

0 comments on commit 5f25dff

Please sign in to comment.