Use unwind protection to clean up data structures in modules
commit5d29c0f006d071008eba8d235db917d5c8b271bb
authorPhilipp Stephani <phst@google.com>
Mon, 5 Jun 2017 11:05:51 +0000 (5 13:05 +0200)
committerPhilipp Stephani <phst@google.com>
Mon, 5 Jun 2017 13:10:24 +0000 (5 15:10 +0200)
tree4203cbc6db953bf258432b64b8437d535a925f8c
parent9f496c591d457b511a42c0f63e0d2d923cda0247
Use unwind protection to clean up data structures in modules

Reuse existing functionality and simplify the code a bit.

* src/emacs-module.c (Fmodule_load): Use unwind protection to clean up
runtime object.
(funcall_module): Use unwind protection to clean up environment
object.
(finalize_environment): Simplify signature.
(finalize_environment_unwind, finalize_runtime_unwind): New functions.
src/emacs-module.c