static gboolean presence_response_main_loop_quit_idle(gpointer p)
{
g_main_loop_quit(g_loop);
+ g_main_loop_unref(g_loop);
+ g_loop = NULL;
return G_SOURCE_REMOVE;
}
nRet = iotcon_query_destroy(hQuery);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_destroy", IotConGetError(nRet));
- g_main_loop_run(g_loop);
- g_main_loop_unref(g_loop);
- g_loop = NULL;
+ if(g_loop)
+ {
+ g_main_loop_run(g_loop);
+ g_main_loop_unref(g_loop);
+ g_loop = NULL;
+ }
DestroyResource();
{
g_main_loop_quit(g_loop);
+ g_main_loop_unref(g_loop);
+ g_loop = NULL;
return G_SOURCE_REMOVE;
}
return 1;
}
- g_main_loop_run(g_loop);
- g_main_loop_unref(g_loop);
- g_loop = NULL;
+ if(g_loop)
+ {
+ g_main_loop_run(g_loop);
+ g_main_loop_unref(g_loop);
+ g_loop = NULL;
+ }
iotcon_query_destroy(hQuery);
presence_destroy_resource();
{
g_main_loop_quit(g_pMainLoop);
+ g_main_loop_unref(g_pMainLoop);
+ g_pMainLoop = NULL;
return G_SOURCE_REMOVE;
}
}
nRet = iotcon_query_destroy(hQuery);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_destroy", IotConGetError(nRet));
-
- g_main_loop_run(g_pMainLoop);
- g_main_loop_unref(g_pMainLoop);
+
+ if(g_pMainLoop)
+ {
+ g_main_loop_run(g_pMainLoop);
+ g_main_loop_unref(g_pMainLoop);
+ g_pMainLoop = NULL;
+ }
if(g_bRequestHandlerCB != true)
{
{
g_main_loop_quit(g_pMainLoop);
+ g_main_loop_unref(g_pMainLoop);
+ g_pMainLoop = NULL;
return G_SOURCE_REMOVE;
}
}
nRet = iotcon_query_destroy(hQuery);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_destroy", IotConGetError(nRet));
-
- g_main_loop_run(g_pMainLoop);
- g_main_loop_unref(g_pMainLoop);
+
+ if(g_pMainLoop)
+ {
+ g_main_loop_run(g_pMainLoop);
+ g_main_loop_unref(g_pMainLoop);
+ g_pMainLoop = NULL;
+ }
if(g_bRequestHandlerCB != true)
{
static gboolean gmain_loop_quit_idle(gpointer p)
{
g_main_loop_quit(g_loop);
+ g_main_loop_unref(g_loop);
+ g_loop = NULL;
return G_SOURCE_REMOVE;
}
/**
nRet = iotcon_query_destroy(hQuery);
PRINT_RESULT_NORETURN(IOTCON_ERROR_NONE, nRet, "iotcon_query_destroy", IotConGetError(nRet));
- g_main_loop_run(g_loop);
- g_main_loop_unref(g_loop);
+ if(g_loop)
+ {
+ g_main_loop_run(g_loop);
+ g_main_loop_unref(g_loop);
+ g_loop = NULL;
+ }
if(g_bRequestRespHandlerCB != true)
{