framework: call destroy directly instead of using atexit
commitc2b31333926a6171c3c02d182b756efad7770410
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 24 Oct 2024 11:49:28 +0000 (24 07:49 -0400)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 24 Oct 2024 14:41:49 +0000 (24 10:41 -0400)
tree0c6a2b8341756cc74d9be4e8271fd75f501785ee
parenta068c5e129b07bd31d9a98721c3c7ab0611b6868
framework: call destroy directly instead of using atexit

There are two possible factories:
* `piglit_fbo_framework_create` has a `destroy` function which is called inline in `run_test` before `piglit_report_result`, so this shouldn't need an atexit
* `piglit_winsys_framework_init` has no destroy function, so there is nothing to call

by adding a hook to be called directly by `piglit_report_result`, the whole
atexit thing can be avoided, and instead `piglit_report_result` can just call
the fbo framework destructor as needed

Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/966>
tests/util/piglit-framework-gl.c
tests/util/piglit-framework-gl/piglit_fbo_framework.c
tests/util/piglit-util.c
tests/util/piglit-util.h