Skip to content

Commit

Permalink
Deinit
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogs9 authored and Your Name committed Mar 30, 2021
1 parent 123427f commit ebcb544
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/c/core/session/session.c
Expand Up @@ -239,7 +239,9 @@ bool uxr_create_session(
bool uxr_delete_session_retries(
uxrSession* session,
size_t retries)
{
{
UXR_CLEAN_INTERPROCESS();

uint8_t delete_session_buffer[DELETE_SESSION_MAX_MSG_SIZE];
ucdrBuffer ub;
ucdr_init_buffer_origin_offset(&ub, delete_session_buffer, DELETE_SESSION_MAX_MSG_SIZE, 0u, uxr_session_header_offset(
Expand Down
4 changes: 4 additions & 0 deletions src/c/profile/multithread/interprocess.c
Expand Up @@ -66,6 +66,10 @@ void uxr_init_static_list(){
}
}

void uxr_deinit_static_list(){
memset(&uxr_ip_map, 0, sizeof(uxr_ip_map));
}

// API

bool uxr_interprocess_entity_compare(uxr_interprocess_entity_t* e1, uxr_interprocess_entity_t* e2)
Expand Down
8 changes: 8 additions & 0 deletions src/c/profile/multithread/interprocess_internal.h
Expand Up @@ -31,12 +31,14 @@ extern "C"
#define UXR_PREPARE_INTERPROCESS(a,b,c,d) uxr_prepare_interprocess(a,b,c,d)
#define UXR_HANDLE_INTERPROCESS() uxr_handle_interprocess()
#define UXR_ADD_INTERPROCESS_ENTITY_XML(a,b,c) uxr_add_interprocess_entity_xml(a,b,c)
#define UXR_CLEAN_INTERPROCESS() uxr_deinit_static_list()

#else // UCLIENT_PROFILE_INTERPROCESS

#define UXR_PREPARE_INTERPROCESS(a,b,c,d)
#define UXR_HANDLE_INTERPROCESS()
#define UXR_ADD_INTERPROCESS_ENTITY(a,b,c)
#define UXR_CLEAN_INTERPROCESS()

#endif // UCLIENT_PROFILE_INTERPROCESS

Expand All @@ -58,6 +60,12 @@ UXRDLLAPI void uxr_handle_interprocess();
*/
UXRDLLAPI void uxr_add_interprocess_entity_xml(uxrSession* session, uxrObjectId entity_id, const char* xml);

/**
* @brief
* TODO
*/
UXRDLLAPI void uxr_deinit_static_list();

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit ebcb544

Please sign in to comment.