It fixes memory leak in daemon
Change-Id: I3b2616f93e560b73cf0381a46aea4ba04ebe4170
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
m_listener_ids.erase(ch);
}
- if (ch->loop()) {
- ch->loop()->add_idle_event(0, [](size_t, void* data) {
- channel* c = (channel*)data;
- delete c;
- }, ch);
- } else {
+ if (!ch->loop())
_D("Should not be here : channel[%p]", ch);
- }
}
void server_channel_handler::read(channel *ch, message &msg)
if (condition & (EVENT_HUP)) {
_D("Disconnect[%p] : The other proccess is dead", this);
m_ch->disconnect();
+ delete m_ch;
m_ch = NULL;
return false;
}