From: Patrick Boettcher
Date: Sun, 3 Feb 2019 12:29:14 +0000 (+0100) Subject: bindings: cxx: do not initialize a chip's shared_ptr with nullptr X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e474b7792adce5ffa81e964ffd5a6302388c8b3a;p=qemu-gpiodev%2Flibgpiod.git bindings: cxx: do not initialize a chip's shared_ptr with nullptr A shared_ptr initialized with nullptr will still call the deleter which causes a NULL-pointer dereference if we create a chip_iter when there are no GPIO chips in the system. Only initialize the current chip object in chip_iter if gpiod_chip_iter_next_noclose() returned a valid pointer. Signed-off-by: Patrick Boettcher
[Bartosz:
- tweaked the commit message
- use std::move when assigning the chip object]
Signed-off-by: Bartosz Golaszewski