Filter/C++: Fix potential memory leak.
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 20 Jan 2020 10:06:42 +0000 (19:06 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 11 Feb 2020 10:02:52 +0000 (02:02 -0800)
commit52abd45f2bc9ad36589aa5111036ea588981d5ff
tree81799bf41db2db1983e2173426f203b6b8d28afe
parent4d29597702112fde295c4b6a7204d75b4b53aa8d
Filter/C++: Fix potential memory leak.

dlclose() should not be called if the target-library's contents may
be refered later.

dlclose() should be called at the exit of a pipeline to avoid
memory leaks of user applications.

Thus, we need to call dlclose for all handles at the ensured exit
point.

They are named with underbar (_) because register is a keyword.

Changes in v2:
- Added lock for handles
- Don't call dlclose at exit context if it's GLIBC 2.23

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
ext/nnstreamer/tensor_filter/tensor_filter_cpp.cc
ext/nnstreamer/tensor_filter/tensor_filter_cpp.hh