diff --git a/src/packages/game/IZ_app.c b/src/packages/game/IZ_app.c index f0ce4f5..0d50394 100644 --- a/src/packages/game/IZ_app.c +++ b/src/packages/game/IZ_app.c @@ -72,8 +72,7 @@ IZ_AppInitializeResult IZ_AppInitialize(struct IZ_App* app, u8 argc, const char* void IZ_AppTeardown(struct IZ_App* app) { IZ_PoolTeardown(&app->pool); - IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "net", "Shutting down..."); - IZ_NetClientDisconnect(&app->net_state); + IZ_NetClientTeardown(&app->net_state); IZ_InputTeardown(&app->input_state); IZ_VideoTeardown(&app->video_state); IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "global", "Stopping %s...", IZ_APP_NAME); diff --git a/src/packages/net/IZ_net_client.c b/src/packages/net/IZ_net_client.c index 6a9f65d..793f418 100644 --- a/src/packages/net/IZ_net_client.c +++ b/src/packages/net/IZ_net_client.c @@ -122,6 +122,11 @@ IZ_ProcedureResult IZ_NetClientInitialize( return 0; } +void IZ_NetClientTeardown(IZ_NetClientState* state) { + IZ_LogInfo(IZ_LOG_CATEGORY_GLOBAL, "net", "Shutting down..."); + IZ_NetClientDisconnect(state); +} + void IZ_NetClientConnect(IZ_NetClientState* state, IZ_WSClientInitializeParams params) { if (!state->callback) { return; diff --git a/src/packages/net/IZ_net_client.h b/src/packages/net/IZ_net_client.h index 4f57fe9..947c759 100644 --- a/src/packages/net/IZ_net_client.h +++ b/src/packages/net/IZ_net_client.h @@ -77,4 +77,6 @@ void IZ_NetClientSendBinaryMessage(IZ_NetClientState*, void*, size_t); void IZ_NetClientSendTextMessage(IZ_NetClientState*, char*, size_t); +void IZ_NetClientTeardown(IZ_NetClientState*); + #endif