Made rest-engine handle multiple init without dropping resources.
This commit is contained in:
parent
2351ee078a
commit
539e92c084
|
@ -70,6 +70,15 @@ LIST(restful_periodic_services);
|
||||||
void
|
void
|
||||||
rest_init_engine(void)
|
rest_init_engine(void)
|
||||||
{
|
{
|
||||||
|
/* avoid initializing twice */
|
||||||
|
static uint8_t initialized = 0;
|
||||||
|
|
||||||
|
if(initialized) {
|
||||||
|
PRINTF("REST engine process already running - double initialization?\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
initialized = 1;
|
||||||
|
|
||||||
list_init(restful_services);
|
list_init(restful_services);
|
||||||
|
|
||||||
REST.set_service_callback(rest_invoke_restful_service);
|
REST.set_service_callback(rest_invoke_restful_service);
|
||||||
|
|
Loading…
Reference in a new issue