[Filter/TFLite] Fix delegates deleter usage
authorJulien Vuillaumier <julien.vuillaumier@nxp.com>
Wed, 15 Dec 2021 18:23:21 +0000 (19:23 +0100)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Tue, 21 Dec 2021 02:54:40 +0000 (11:54 +0900)
commit8155d7944b4520b080399c79e82192f7a5d03dec
treef4786c0603f07333528acf881bfab5600c35cf05
parent42b797f74e5c901c3c471ae04b4c65b96a6f920d
[Filter/TFLite] Fix delegates deleter usage

On pipeline stop, crash in TFLite filter may be seen with some
delegates with log signature:

Setting pipeline to NULL ...
free(): invalid pointer

Pipeline termination procedure is then aborted.

TFlite delegates shall be released by specific deleter, provided
by their respective interface.
TFLite filter implementation manages delegates instance with
smart pointers for automatic disposal when interpreter goes out of
of scope.

Care should be taken to bind relevant delegate deleter to the
smart pointer, otherwise trivial deleter is used for the managed
pointer which may crash.

Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.cc