summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2018-12-26 15:46:27 +0900
committerMinje Ahn <minje.ahn@samsung.com>2018-12-26 15:46:27 +0900
commitfccddb616688f39af581aaaffc964aab5efa0af4 (patch)
tree6943f2b47fc4328fdcd55a906e126ce76e3f2385
parent06ec6d10aba9295105d779a0fe04e4c115d182a1 (diff)
downloadlibmedia-thumbnail-fccddb616688f39af581aaaffc964aab5efa0af4.tar.gz
libmedia-thumbnail-fccddb616688f39af581aaaffc964aab5efa0af4.tar.bz2
libmedia-thumbnail-fccddb616688f39af581aaaffc964aab5efa0af4.zip
Fix memory leak issuesubmit/tizen/20190104.070559
Change-Id: Idd9b8e6d17a81639f51f0d0e17a99083938f936b Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
-rwxr-xr-xsrc/ipc/media-thumb-ipc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ipc/media-thumb-ipc.c b/src/ipc/media-thumb-ipc.c
index a127b02..ed5ecb7 100755
--- a/src/ipc/media-thumb-ipc.c
+++ b/src/ipc/media-thumb-ipc.c
@@ -81,15 +81,17 @@ int _media_thumb_get_error()
void __media_thumb_pop()
{
int len = 0;
+ int sock = 0;
if (g_manage_queue != NULL) {
thumbReq *req = (thumbReq *)g_queue_pop_head(g_manage_queue);
if (req != NULL) {
GSource *source_id = g_main_context_find_source_by_id(g_main_context_get_thread_default(), req->source_id);
+ sock = g_io_channel_unix_get_fd(req->channel);
g_io_channel_shutdown(req->channel, TRUE, NULL);
g_io_channel_unref(req->channel);
-
+ close(sock);
if (source_id != NULL) {
g_source_destroy(source_id);
} else {
@@ -148,15 +150,17 @@ int __media_thumb_cancel(unsigned int request_id)
void __media_thumb_pop_raw_data()
{
int len = 0;
+ int sock = 0;
if (g_manage_raw_queue != NULL) {
thumbRawReq *req = (thumbRawReq *)g_queue_pop_head(g_manage_raw_queue);
if (req != NULL) {
GSource *source_id = g_main_context_find_source_by_id(g_main_context_get_thread_default(), req->source_id);
+ sock = g_io_channel_unix_get_fd(req->channel);
g_io_channel_shutdown(req->channel, TRUE, NULL);
g_io_channel_unref(req->channel);
-
+ close(sock);
if (source_id != NULL) {
g_source_destroy(source_id);
} else {