Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions gcs/src/gcs_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ gcs_group_init (gcs_group_t* group, gu::Config* const cnf, gcache_t* const cache
int const appl_proto_ver)
{
// here we also create default node instance.
new (&group->memb_mtx_) gu::Mutex(NULL);
group->cache = cache;
group->act_id_ = GCS_SEQNO_ILL;
group->conf_id = GCS_SEQNO_ILL;
Expand Down Expand Up @@ -185,8 +186,13 @@ gcs_group_free (gcs_group_t* group)
if (group->my_address) free ((char*)group->my_address);
delete group->vote_history;

gu::Lock lock(group->memb_mtx_);
group_nodes_free (group);
{
gu::Lock lock(group->memb_mtx_);
group_nodes_free (group);
}

// manually release memb_mtx_ after placement-new.
group->memb_mtx_.~Mutex();
}

/* Reset nodes array without breaking the statistics */
Expand Down