X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=gacela.lisp;h=6ad199f314623426210e823ef26e4555b20a1391;hb=d672794dd75f5607aa8b60d5b67474887cd6ae73;hp=8cd0da8271b25d7324862b454a0cd7054412be3f;hpb=c31ef82b8f98c9011aa5a80777ad374566d743aa;p=gacela.git diff --git a/gacela.lisp b/gacela.lisp index 8cd0da8..6ad199f 100644 --- a/gacela.lisp +++ b/gacela.lisp @@ -172,7 +172,7 @@ :constructor constructor :destructor destructor :free-function free-function - :time (if static -1 (SDL_GetTicks))))) + :time (if static t (SDL_GetTicks))))) (defun get-resource (key) (let ((resource (gethash key resources-table))) @@ -182,10 +182,12 @@ (setf (gethash key resources-table) resource))) (resource-plist resource))))) + (defun free-resource (key) + (funcall (resource-destructor (gethash key resources-table))) + (setf (resource-time (gethash key resources-table)) nil)) + (defun free-all-resources () - (maphash (lambda (key res) (funcall (resource-free-function res) (resource-address res))) - resources-table) - (clrhash resources-table))) + (maphash (lambda (key res) (free-resource key)) resources-table))) ;;; Connection with the GUI