[libcamera-devel] [PATCH] ipa: raspberrypi: Fix crash under LTO
Dave Jones
dave.jones at canonical.com
Fri Mar 10 22:31:12 CET 2023
On Fri, Mar 10, 2023 at 01:43:44PM +0000, Naushir Patuck wrote:
>On Fri, 10 Mar 2023 at 13:41, Laurent Pinchart <
>laurent.pinchart at ideasonboard.com> wrote:
[snip]
>> Unless I'm mistaken, given that you're using a unique pointer, the
>> object will get deleted at deinit time. It should thus be functionally
>> equivalent to the static variable in v2.
>>
>> We *could* allocate the objects dynamically without std::unique_ptr to
>> avoid deinit issues, but we would then leak memory. That won't cause any
>> issue in production, but for development it's nice if we can run
>> libcamera applications under valgrind and expect no leaks.
The valgrind point is certainly a powerful argument in favour of using a
static object here.
>The unique_ptr was my addition to avoid leaks in debug.
>I think using a static object like in v2 ought to be good for this fix.
Yes, it's a much nicer "read" than repeating all the map gubbins.
More information about the libcamera-devel
mailing list