shared: Fix to release channel resources when sensor_listener is released 12/319512/2 accepted/tizen_9.0_unified tizen_9.0 accepted/tizen/9.0/unified/20250214.183535
authorSangYoun Kwak <sy.kwak@samsung.com>
Wed, 12 Feb 2025 03:12:00 +0000 (12:12 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Wed, 12 Feb 2025 07:30:54 +0000 (16:30 +0900)
commit45db094f6ea0c2a9253959e5611ef11814656d0f
tree6369cea52f1cadf229e4bcc8be5315ab330a6472
parentf75f17291ea3b29758ce4d4600db7392d6d823af
shared: Fix to release channel resources when sensor_listener is released

In the event loop object, channel resources(class 'channel' and
'channel_handler') to be released are added to the queues through
functions: add_channel_release_queue, add_channel_handler_release_list
respectively.

Resources contained by these queues should be freed by function
g_io_handler but this function is called when channel receives a
event(GLib.IOCondition) and if no event is occured, resources are not
released. This may cause resources like socket fd, memory flooded, so
they should be released

To resolve this issue, a function is added to the event_loop class to
release resources contained by the queues and that function is called by
the sensor_listener when it is released.

Change-Id: I7eb1be520a6dd756a6cd2718ce15ec813973ecb0
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
src/client/sensor_listener.cpp
src/shared/event_loop.cpp
src/shared/event_loop.h