buffer_stream: do not crash on shutdown
When destructing the users, they attempt to drop the ring they own. This works by checking Strm's list of rings. But when Strm is destructed, all rings are deleted as well which results in a segfault.
This commit is contained in:
parent
e6179904c7
commit
90e1ba7308
1 changed files with 1 additions and 1 deletions
|
@ -27,7 +27,6 @@ Buffer::Stream::Stream(){
|
||||||
|
|
||||||
/// Do cleanup on delete.
|
/// Do cleanup on delete.
|
||||||
Buffer::Stream::~Stream(){
|
Buffer::Stream::~Stream(){
|
||||||
delete Strm;
|
|
||||||
while (users.size() > 0){
|
while (users.size() > 0){
|
||||||
stats_mutex.lock();
|
stats_mutex.lock();
|
||||||
for (usersIt = users.begin(); usersIt != users.end(); usersIt++){
|
for (usersIt = users.begin(); usersIt != users.end(); usersIt++){
|
||||||
|
@ -42,6 +41,7 @@ Buffer::Stream::~Stream(){
|
||||||
moreData.notify_all();
|
moreData.notify_all();
|
||||||
cleanUsers();
|
cleanUsers();
|
||||||
}
|
}
|
||||||
|
delete Strm;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Calculate and return the current statistics in JSON format.
|
/// Calculate and return the current statistics in JSON format.
|
||||||
|
|
Loading…
Add table
Reference in a new issue