fix: sessionmanager life expired under my feet
This commit is contained in:
parent
9f7e7e30e2
commit
2a1b30e166
6 changed files with 58 additions and 22 deletions
|
|
@ -30,19 +30,10 @@ EndpointHandler::EndpointHandler(uint64_t idx, Flows flow) {
|
|||
this->ep = (flow == Flows::FLOW_PLAYBACK ? osh->getPlaybackEndpoints().at(idx) : osh->getCaptureEndpoints().at(idx));
|
||||
|
||||
epc = new EndpointVolumeCallback(ep);
|
||||
ensc = new EndpointNewSessionCallback(this);
|
||||
this->callbackInfo.caller = osh->getGuid();
|
||||
ep->registerNewSessionNotification(ensc);
|
||||
//epName = ep->getName();
|
||||
this->setBackEndpointVolumeCallbackInfoContent(this->getState());
|
||||
osh->pushBackEndpointHandler(this, flow);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void OverseerHandler::pushBackEndpointHandler(EndpointHandler* eph, Flows flow) {
|
||||
|
|
@ -215,6 +206,28 @@ void EndpointHandler::removeSessionFromFront(SessionHandler* sh) {
|
|||
this->removeSessionWidget(sh);
|
||||
}
|
||||
|
||||
void EndpointHandler::deleteSessions() {
|
||||
ep->unregisterNewSessionNotification(ensc);
|
||||
ensc->Release();
|
||||
for (auto sh : sessionHandlers) {
|
||||
delete sh;
|
||||
}
|
||||
sessionHandlers.resize(0);
|
||||
ep->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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EndpointHandler::~EndpointHandler() {
|
||||
ep->removeVolumeCallback(epc);
|
||||
ep->unregisterNewSessionNotification(ensc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue