org-element: Fix leakage in objects cache
commitec65bacc1489da6ea9b91c949e4e0d686b31daec
authorNicolas Goaziou <n.goaziou@gmail.com>
Sat, 19 Apr 2014 19:45:57 +0000 (19 21:45 +0200)
committerNicolas Goaziou <n.goaziou@gmail.com>
Sat, 19 Apr 2014 19:51:56 +0000 (19 21:51 +0200)
tree0bd5ba4ac825da8fbb8949f45153eda78785b22c
parent55e46fc2601b442c3342cb32387f60ff93a5feb2
org-element: Fix leakage in objects cache

* lisp/org-element.el (org-element--cache-remove): New function.
(org-element--cache-process-request): Use new function.
(org-element-cache-reset): Do not rely on a weak hash table to handle
objects cache.

Elements used as keys in object cache cannot be garbage collected
since they appear in the :parent hierarchy in objects.  Instead we
remove entries from the objects cache whenever an element is removed
from the element cache.
lisp/org-element.el