{
if (__pEventFdSource)
{
- g_source_destroy(__pEventFdSource);
g_source_unref(__pEventFdSource);
+ g_source_destroy(__pEventFdSource);
__pEventFdSource = null;
}
g_io_channel_set_encoding(__pEventFdIo, null, &pGError);
g_io_channel_set_flags(__pEventFdIo, G_IO_FLAG_NONBLOCK, &pGError);
+ g_io_channel_set_close_on_unref(__pEventFdIo, TRUE);
+ eventFd = -1;
+
__pEventFdSource = g_io_create_watch(__pEventFdIo, G_IO_IN);
SysTryCatch(NID_BASE_RT, __pEventFdSource != null, r = E_SYSTEM, E_SYSTEM,
"[E_SYSTEM] Failed to create a gsource for a channel.");
if (__pEventFdSource)
{
g_source_unref(__pEventFdSource);
+ g_source_destroy(__pEventFdSource);
__pEventFdSource = null;
}
__pEventFdIo = null;
}
+ if (eventFd != -1)
+ {
+ close(eventFd);
+ }
+
return r;
}
if (__pSource)
{
- g_source_destroy(__pSource);
g_source_unref(__pSource);
+ g_source_destroy(__pSource);
}
if (__pChannel)
if (pSource)
{
- g_source_destroy(pSource);
g_source_unref(pSource);
+ g_source_destroy(pSource);
}
if (pChannel)
if (__pSource)
{
g_source_unref(__pSource);
+ g_source_destroy(__pSource);
__pSource = null;
}
g_io_channel_set_encoding(__pChannel, null, &pGError);
g_io_channel_set_flags(__pChannel, G_IO_FLAG_NONBLOCK, &pGError);
+ g_io_channel_set_close_on_unref(__pChannel, TRUE);
+ eventFd = -1;
+
__pSource = g_io_create_watch(__pChannel, G_IO_IN);
SysTryCatch(NID_BASE_RT, __pSource != null, r = E_SYSTEM, E_SYSTEM,
"[E_SYSTEM] Failed to create a gsource for a channel.");
if (__pSource)
{
g_source_unref(__pSource);
+ g_source_destroy(__pSource);
__pSource = null;
}
__pChannel = null;
}
+ if (eventFd != -1)
+ {
+ close(eventFd);
+ }
return r;
}