Skip to content

Commit

Permalink
capture source crash
Browse files Browse the repository at this point in the history
  • Loading branch information
summeroff committed Oct 23, 2024
1 parent ab12d39 commit 57e195b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions libobs/obs.c
Original file line number Diff line number Diff line change
Expand Up @@ -3434,8 +3434,12 @@ void obs_context_data_remove_name(struct obs_context_data *context, void *phead)
if (!context)
return;

struct obs_context_data *item = NULL;
pthread_mutex_lock(context->mutex);
HASH_DELETE(hh, *head, context);
HASH_FIND_STR(*head, context->name, item);
if (item) {
HASH_DELETE(hh, *head, context);
}
pthread_mutex_unlock(context->mutex);
}

Expand All @@ -3449,8 +3453,14 @@ void obs_context_data_remove_uuid(struct obs_context_data *context,
if (!context || !context->uuid || !uuid_head)
return;

struct obs_context_data *item = NULL;

pthread_mutex_lock(context->mutex);
HASH_DELETE(hh_uuid, *uuid_head, context);
HASH_FIND_UUID(*uuid_head, context->uuid, item);
if (item) {
HASH_DELETE(hh_uuid, *uuid_head, context);
}

pthread_mutex_unlock(context->mutex);
}

Expand Down

0 comments on commit 57e195b

Please sign in to comment.