New error interface: migrated core, backends and frontends to it
[cascardo/atompub.git] / src / main.c
index c6781a6..4c10bd1 100644 (file)
@@ -32,16 +32,17 @@ main (int argc, char **argv)
   AtomCtx *ctx;
   IRI *iri;
   Atom *atom;
-  GError *error;
+  AtomError *error;
   g_type_init ();
   ctx = atom_ctx_new ();
   atom_config_init (ctx);
   atom_backend_set (ctx, giochannel_backend ());
   if ((error = atom_error_get (ctx)) != NULL)
     {
-      g_message ("%s\n", error->message);
+      g_message ("%s\n", atom_error_message (error));
       exit (1);
     }
   cgi_serve_request (ctx);
+  atom_ctx_delete (ctx);
   return 0;
 }