libcamera/include
Laurent Pinchart 01e387acb0 libcamera: log: Destroy LogCategory instances in a controlled way
The LogCategory instances are constructed on first use as static
variables in accessor functions, following the Meyers singleton pattern.
As a result, their destruction order is not guaranteed. This can cause
issues as the global Logger object, constructed in a similar fashion, is
accessed from the LogCategory destructor and may be destroyed first.

To fix this, keep the same singleton pattern, but allocate the
LogCategory instances dynamically. As they get registered with the
global Logger instance, we can destroy them in the Logger destructor.

This only avoids destruction order issues between LogCategory and
Logger, and doesn't address yet the fact that LOG() calls from
destructors of global objects may access an already destroyed Logger.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chormium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2021-06-15 12:46:39 +03:00
..
android android: Update Android headers 2021-05-31 19:26:59 +03:00
libcamera libcamera: log: Destroy LogCategory instances in a controlled way 2021-06-15 12:46:39 +03:00
linux include: linux: Update Linux headers to v5.12-rc1 2021-03-03 19:41:04 +02:00
meson.build libcamera: Move IPA headers from include/ipa/ to include/libcamera/ipa/ 2020-05-16 03:38:47 +03:00