summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2016-03-25 17:00:04 +0900
committerJunghoon Park <jh9216.park@samsung.com>2016-04-05 19:04:55 -0700
commit07d22307667ab6ea1e0a5d558d4fcdf96e2d1166 (patch)
tree340fc28da44b9b35087ac1d3847a24c0e330e5c7
parent0f52998ab170620ce850d3260754db71a930bc7f (diff)
downloadlaunchpad-07d22307667ab6ea1e0a5d558d4fcdf96e2d1166.tar.gz
launchpad-07d22307667ab6ea1e0a5d558d4fcdf96e2d1166.tar.bz2
launchpad-07d22307667ab6ea1e0a5d558d4fcdf96e2d1166.zip
Fix handle leak
Change-Id: If858bfa21bdc9aeee693497a3b9f3bdc8f44d2e1 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rwxr-xr-xsrc/launchpad.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/launchpad.c b/src/launchpad.c
index 148c2a8..e6c13ea 100755
--- a/src/launchpad.c
+++ b/src/launchpad.c
@@ -670,11 +670,26 @@ static gboolean __glib_prepare(GSource *src, gint *timeout)
return FALSE;
}
+static void __glib_finalize(GSource *src)
+{
+ GSList *fd_list;
+ GPollFD *gpollfd;
+
+ fd_list = src->poll_fds;
+ do {
+ gpollfd = (GPollFD *)fd_list->data;
+ close(gpollfd->fd);
+ g_free(gpollfd);
+
+ fd_list = fd_list->next;
+ } while (fd_list);
+}
+
static GSourceFuncs funcs = {
.prepare = __glib_prepare,
.check = __glib_check,
.dispatch = __glib_dispatch,
- .finalize = NULL
+ .finalize = __glib_finalize
};
static guint __poll_fd(int fd, gushort events, GSourceFunc func, int type, int loader_id)