Skip to content

Commit

Permalink
fix(sanitizer): fix thread issues reported by the sanitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
parfeon committed Oct 14, 2024
1 parent 0a1863e commit 6c7d785
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/pbcc_subscribe_event_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ pbcc_subscribe_ee_t* pbcc_subscribe_ee_alloc(pubnub_t* pb)
PBARRAY_CHAR_CONTENT_TYPE,
(pbarray_element_free)free);
ee->current_transaction = PBTT_NONE;
ee->cancel_invocation = NULL;
pubnub_mutex_init(ee->mutw);

if (NULL == ee->subscriptions) {
Expand Down
4 changes: 4 additions & 0 deletions core/pbcc_subscribe_event_listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ pbcc_event_listener_t* pbcc_event_listener_alloc(const pubnub_t* pb)
{
PBCC_ALLOCATE_TYPE(listener, pbcc_event_listener_t, true, NULL);
pubnub_mutex_init(listener->mutw);
listener->global_events = NULL;
listener->global_status = NULL;
listener->listeners = NULL;
listener->pb = pb;

return listener;
Expand Down Expand Up @@ -513,6 +516,7 @@ pbcc_object_listener_t* pbcc_object_listener_alloc_(char* name)
{
PBCC_ALLOCATE_TYPE(updates, pbcc_object_listener_t, true, NULL);
updates->name = name;
updates->listeners = NULL;
pbcc_initialize_array_(
&updates->listeners,
(pbarray_element_free)pbcc_listener_free_);
Expand Down

0 comments on commit 6c7d785

Please sign in to comment.