stoopid pointer

This commit is contained in:
Hane 2023-08-23 23:12:30 +02:00
commit b1ada032fb
3 changed files with 4 additions and 4 deletions

View file

@ -42,7 +42,7 @@ HRESULT EndpointCallback::OnNotify(PAUDIO_VOLUME_NOTIFICATION_DATA pNotify) {
//TODO: MEMORY LEAK. FREE DATA4 FROM NGUID.
//TODO: el default = objcopy frees?
//delete osh->getEndpointHandlers().at(this->ep->getIndex())->getCallbackInfo()->caller;
memcpy(osh->getEndpointHandlers().at(this->ep->getIndex())->getCallbackInfo()->caller, &pNotify->guidEventContext,sizeof(NGuid) );
memcpy(&osh->getEndpointHandlers().at(this->ep->getIndex())->getCallbackInfo()->caller, &pNotify->guidEventContext,sizeof(NGuid) );
osh->getEndpointHandlers().at(this->ep->getIndex())->getCallbackInfo()->muted = pNotify->bMuted;
osh->getEndpointHandlers().at(this->ep->getIndex())->getCallbackInfo()->mainVolume = pNotify->fMasterVolume;

View file

@ -21,7 +21,7 @@ struct NGuid {
};
struct BackEndpointCallbackInfo {
NGuid* caller = new NGuid();
NGuid caller;
bool muted;
float mainVolume;
size_t channels;

View file

@ -94,7 +94,7 @@ EndpointWidget::EndpointWidget(uint64_t idx, EndpointHandler* eph, QWidget *pare
//TODO: el default = objcopy frees?
//delete eph->getCallbackInfo()->caller;
*eph->getCallbackInfo()->caller = *osh->getGuid();
eph->getCallbackInfo()->caller = *osh->getGuid();
mainSlider->blockSignals(false);
muteButton->blockSignals(false);
});
@ -188,7 +188,7 @@ void MainWindow::reloadEndpointWidgets() {
size_t i = 0;
for (; i < (osh->getEndpointHandlers().size()); i++) {
log_debugcpp("EPWidget creation");
*osh->getEndpointHandlers().at(i)->getCallbackInfo()->caller = *osh->getGuid();
osh->getEndpointHandlers().at(i)->getCallbackInfo()->caller = *osh->getGuid();
EndpointWidget *epw = new EndpointWidget(i, osh->getEndpointHandlers().at(i), widget);
//TODO: ALWAYS PUSH BACK??? PSZ CHANGE DIS WHEN IMPLEMENTING DYN ENDPOINT DET
ews.push_back(epw);