mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
logs: setup earlier so we can use on fail path
https://github.com/warmcat/libwebsockets/issues/2679
This commit is contained in:
parent
dcca7a514d
commit
b0b4f0dd56
1 changed files with 6 additions and 2 deletions
|
@ -630,6 +630,12 @@ lws_create_context(const struct lws_context_creation_info *info)
|
|||
goto early_bail;
|
||||
}
|
||||
|
||||
#if defined(LWS_WITH_SYS_STATE)
|
||||
// NOTE: we need to init this fields because they may be used in logger when context destroying
|
||||
context->mgr_system.state_names = system_state_names;
|
||||
context->mgr_system.context = context;
|
||||
#endif
|
||||
|
||||
#if defined(LWS_WITH_NETWORK)
|
||||
context->event_loop_ops = plev->ops;
|
||||
context->us_wait_resolution = us_wait_resolution;
|
||||
|
@ -1375,11 +1381,9 @@ lws_create_context(const struct lws_context_creation_info *info)
|
|||
* init the lws_state mgr for the system state
|
||||
*/
|
||||
|
||||
context->mgr_system.state_names = system_state_names;
|
||||
context->mgr_system.name = "system";
|
||||
context->mgr_system.state = LWS_SYSTATE_CONTEXT_CREATED;
|
||||
context->mgr_system.parent = context;
|
||||
context->mgr_system.context = context;
|
||||
#if defined(LWS_WITH_SYS_SMD)
|
||||
context->mgr_system.smd_class = LWSSMDCL_SYSTEM_STATE;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue