[nemiver/remote-cmdline] Cleanup in main.c



commit f350979428d991011e339cdc3818461301904d2d
Author: Dodji Seketeli <dodji seketeli org>
Date:   Sun Oct 3 19:42:09 2010 +0200

    Cleanup in main.c
    
    	* main (parse_command_line): Use GCharSafePtr.

 src/main.cc |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/main.cc b/src/main.cc
index d57ad31..305a9d0 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -304,15 +304,13 @@ parse_command_line (int& a_argc,
         NEMIVER_CATCH;
         g_error_free (error);
 
-        gchar *help_message = g_option_context_get_help (context.get (),
-                                                         true, NULL);
-        NEMIVER_TRY;
-        cerr << help_message << std::endl;
-        NEMIVER_CATCH;
-
-        g_free (help_message);
+        GCharSafePtr help_message;
+        help_message.reset (g_option_context_get_help (context.get (),
+                                                       true, NULL));
+        cerr << help_message.get () << std::endl;
         return false;
     }
+
     if (a_argv != inf_argv) {
         memmove (a_argv, inf_argv, inf_argc * sizeof (char*));
         a_argc = inf_argc;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]