When reconnecting, close old connections to userClient/statsPage first to prevent accidental killing of outputs.

This commit is contained in:
Thulinma 2015-07-22 09:53:04 +02:00
parent dc6b4ca0b9
commit 0bda57fa0c

View file

@ -122,7 +122,13 @@ namespace Mist {
onFail(); onFail();
return; return;
} }
if (statsPage.getData()){
statsPage.finish();
}
statsPage = IPC::sharedClient(SHM_STATISTICS, STAT_EX_SIZE, true); statsPage = IPC::sharedClient(SHM_STATISTICS, STAT_EX_SIZE, true);
if (userClient.getData()){
userClient.finish();
}
char userPageName[NAME_BUFFER_SIZE]; char userPageName[NAME_BUFFER_SIZE];
snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str()); snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str());
userClient = IPC::sharedClient(userPageName, PLAY_EX_SIZE, true); userClient = IPC::sharedClient(userPageName, PLAY_EX_SIZE, true);