Remove elektraClearError, implement elektraErrorDel
@@ -47,10 +47,19 @@ void elektraClose (Elektra * elektra)
ksDel (elektra->config);
keyDel (elektra->parentKey);
- elektraClearError (elektra);
elektraFree (elektra);
}
+void elektraErrorDel (ElektraError * error)
+{
+ if (error == NULL)
+ {
+ return;
+ }
+
+ elektraFree(error);
+}
+
kdb_boolean_t elektraHasError (const Elektra * elektra)
{
return elektra->error != NULL;
@@ -61,12 +70,6 @@ const char * elektraErrorMessage (const Elektra * elektra)
return elektra->error->msg;
}
-void elektraClearError (Elektra * elektra)
-{
- elektraFree (elektra->error);
- elektra->error = NULL;
-}
-
/**
* @param elektra The elektra instance initialized with the parent key.
* @param name The keyname to look up. The keyname is appended to the parent key.
