fix: sessionmanager life expired under my feet

This commit is contained in:
Hane 2024-12-17 00:01:02 +01:00
commit 2a1b30e166
6 changed files with 58 additions and 22 deletions

View file

@ -531,6 +531,7 @@ EndpointWidget::EndpointWidget(EndpointHandler* eph, QWidget *parent, uint64_t i
this->idx = idx;
this->eph = eph;
eph->createSessionHandlers();
//todo: sussy
this->eph->setState(EndpointState::ENDPOINT_ACTIVE, idx);
this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
@ -749,6 +750,10 @@ EndpointWidget::~EndpointWidget() {
timer->stop();
delete timer;
this->eph->setFrontVisibilityInfo(EndpointState::ENDPOINT_ALL, INT_MAX);
this->eph->deleteSessions();
for(auto sw : sessionWidgets) {
delete sw;
}
}
void MainWindow::customEvent(QEvent* ev) {
@ -894,6 +899,8 @@ void EndpointWidget::updateMainVolume(int newValue){
*/
void EndpointWidget::updateChannelsVisibility() {
if (!cw) return;
char* const channelSettings = set->getValue("show_channels");
if(channelSettings && !(strcmp(channelSettings, "true"))){
cw->setVisible(true);