[ML][Single] Fix the crash issue in SingleShot class 43/287543/1 accepted/tizen/unified/20230202.015309
authorSangjung Woo <sangjung.woo@samsung.com>
Thu, 26 Jan 2023 07:46:02 +0000 (16:46 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Tue, 31 Jan 2023 06:52:52 +0000 (15:52 +0900)
commitd5acf81c3ac03c00e66a6398e1ae10a4c27f08c9
treedd9b2c0c9ae9f5f2aa41d68074a3f2bbe0dabf5c
parent3e7d086add409f25a1f7099f7ab4d2aa237639ac
[ML][Single] Fix the crash issue in SingleShot class

ml_single_close() can be called in both Close() method and destructor of
SingleShot class. If the handle is invalid, calling ml_single_close()
can cause the segmentation fault issue. This patch checks whether the
handle is valid or not so it fixes the potential bug.

Change-Id: I0ab94cae99f53d274a091acb3a21403f42664439
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
src/ml/ml_singleshot.cc