From 6697784a1380394a074db1296d0983b2a4281596 Mon Sep 17 00:00:00 2001 From: Luc Yriarte Date: Mon, 22 Jul 2013 11:43:55 +0200 Subject: [PATCH] remove C-style error management --- src/MediaServer/MediaServer.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/MediaServer/MediaServer.cpp b/src/MediaServer/MediaServer.cpp index 76dc8c6..d25d97b 100644 --- a/src/MediaServer/MediaServer.cpp +++ b/src/MediaServer/MediaServer.cpp @@ -52,7 +52,8 @@ void browseFindCallback(GObject *source_object, GAsyncResult *res, gpointer use LoggerD("browseFindCallback success"); } else { LoggerD(gerror->message); - goto Exit; + g_error_free(gerror); + return; } /* convert children to Javascript array */ @@ -62,9 +63,6 @@ void browseFindCallback(GObject *source_object, GAsyncResult *res, gpointer use // FIXME // JSValueRef jsArray = JSValueMakeFromJSONString( FIXME CALLBACK CONTEXT, jsStr); // FIXME: JS callbacks -Exit: - if (gerror) - g_error_free(gerror); g_object_unref(context->cntProxy); } @@ -116,7 +114,8 @@ void MediaServer::browse(std::string containerId, if (gerror) { LoggerD(gerror->message); - goto Exit; + g_error_free(gerror); + return; } upn_pcontainer2__call_list_children_ex ( @@ -129,10 +128,6 @@ void MediaServer::browse(std::string containerId, browseFindCallback, /* callback */ context /* user_data */ ); - -Exit: - if (gerror) - g_error_free(gerror); } @@ -159,7 +154,8 @@ void MediaServer::find(std::string containerId, if (gerror) { LoggerD(gerror->message); - goto Exit; + g_error_free(gerror); + return; } upn_pcontainer2__call_search_objects_ex ( @@ -173,10 +169,6 @@ void MediaServer::find(std::string containerId, browseFindCallback, /* callback */ context /* user_data */ ); - -Exit: - if (gerror) - g_error_free(gerror); } -- 2.7.4