marshalling on sessions, missing override tag

This commit is contained in:
Hane 2025-01-14 19:19:49 +01:00
commit 667482cfea
10 changed files with 57 additions and 15 deletions

View file

@ -191,10 +191,15 @@ Endpoint* EndpointHandler::getEndpoint() {
}
void EndpointHandler::addSessionSendFront(Session* session) {
ep->addSession(session);
if(!ep->endpointSessionsMutex.try_lock()) return;
this->ep->addSession(session);
SessionHandler* sessionHandler = new SessionHandler(this, session, (getSessionCount() - 1));
ep->endpointSessionsMutex.unlock();
sessionHandlersMutex.lock();
sessionHandlers.push_back(sessionHandler);
sessionHandlersMutex.unlock();
this->addSessionWidget(sessionHandler);
}
@ -218,14 +223,24 @@ void EndpointHandler::deleteSessions() {
void EndpointHandler::createSessionHandlers() {
ep->activateEndpointSessions();
ensc = new EndpointNewSessionCallback(this);
ep->registerNewSessionNotification(ensc);
if (this->flow == Flows::FLOW_PLAYBACK) {
for (int i = 0; i < this->getSessionCount(); i++) {
SessionHandler* sessionHandler = new SessionHandler(this, this->getSessions().at(i),i);
sessionHandlers.push_back(sessionHandler);
}
}
}
ensc = new EndpointNewSessionCallback(this);
ep->registerNewSessionNotification(ensc);
}
void EndpointHandler::lockSessionCollections() {
this->sessionHandlersMutex.lock();
this->ep->endpointSessionsMutex.lock();
}
void EndpointHandler::unlockSessionCollections() {
this->sessionHandlersMutex.unlock();
this->ep->endpointSessionsMutex.unlock();
}
EndpointHandler::~EndpointHandler() {
@ -386,6 +401,7 @@ void OverseerHandler::updateFrontEndpointName(Endpoint* ep) {
}
void OverseerHandler::reviseEndpointShowing(std::wstring endpointId, EndpointState state) {
//TODO: Race condition!!!!!
std::vector<EndpointHandler*> allHandlers;
allHandlers.insert(allHandlers.end(), this->captureEndpointHandlers.begin(), this->captureEndpointHandlers.end());
allHandlers.insert(allHandlers.end(), this->playbackEndpointHandlers.begin(), this->playbackEndpointHandlers.end());