mirror of https://github.com/status-im/evmc.git
loader: Make evmc_last_error_msg() return error only once
This commit is contained in:
parent
bde20b1f4c
commit
caf6c2a1bd
|
@ -105,10 +105,12 @@ struct evmc_instance* evmc_load_and_create(const char* filename,
|
|||
|
||||
/**
|
||||
* Returns the human-readable message describing the most recent error
|
||||
* that occurred in EVMC loading.
|
||||
* that occurred in EVMC loading since the last call to this function.
|
||||
*
|
||||
* In case any loading function returned ::EVMC_LOADER_SUCCESS this function always returns NULL.
|
||||
* In case of error code other than success returned, this function MAY return the error message.
|
||||
* Calling this function "consumes" the error message and the function will return NULL
|
||||
* from subsequent invocations.
|
||||
* This function is not thread-safe.
|
||||
*
|
||||
* @return Error message or NULL if no additional information is available.
|
||||
|
|
|
@ -140,7 +140,9 @@ exit:
|
|||
|
||||
const char* evmc_last_error_msg()
|
||||
{
|
||||
return last_error_msg;
|
||||
const char* m = last_error_msg;
|
||||
last_error_msg = NULL;
|
||||
return m;
|
||||
}
|
||||
|
||||
struct evmc_instance* evmc_load_and_create(const char* filename,
|
||||
|
|
Loading…
Reference in New Issue