Fix memleak caused by loadMonitor that is already loaded

This commit is contained in:
Isaac Connor 2021-04-12 15:14:47 -04:00
parent 7e579fd851
commit e373e871da
1 changed files with 6 additions and 5 deletions

View File

@ -485,11 +485,12 @@ void MonitorStream::runStream() {
if (connkey)
checkCommandQueue();
if (!loadMonitor(monitor_id)) {
sendTextFrame("Not connected");
sleep(1);
} else if (!checkInitialised()) {
sendTextFrame("Unable to stream");
if (!checkInitialised()) {
if (!loadMonitor(monitor_id)) {
sendTextFrame("Not connected");
} else {
sendTextFrame("Unable to stream");
}
sleep(1);
} else {
break;