Skip to content

Commit c2fee8c

Browse files
cataliniiCatalin Toda
andauthored
Prevent new objects being created while shutting down (#1311)
Co-authored-by: Catalin Toda <[email protected]>
1 parent cea642f commit c2fee8c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/pmt.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2211,6 +2211,7 @@ char *get_pmt_for_adapter(int aid, char *dest, int max_size) {
22112211

22122212
void free_all_pmts() {
22132213
int i, j;
2214+
std::lock_guard<SMutex> lock(pmts_mutex);
22142215
for (i = 0; i < MAX_PMT; i++) {
22152216
if (pmts[i]) {
22162217
for (j = 0; j < pmts[i]->caids; j++)

src/stream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ int unlock_streams_for_adapter(int aid) {
12471247

12481248
void free_all_streams() {
12491249
int i;
1250-
1250+
std::lock_guard<SMutex> lock(st_mutex);
12511251
for (i = 0; i < MAX_STREAMS; i++) {
12521252
if (st[i])
12531253
delete st[i];

0 commit comments

Comments
 (0)