ui: fix memory corruption by using std::vector for PubMaster initialization (#33390)

Fix memory Corruption Issue
old-commit-hash: 1c19cbc437ad7fdb84f039272bc482440eb41895
This commit is contained in:
Dean Lee 2024-08-28 02:34:28 +08:00 committed by GitHub
parent 55bae8feef
commit 81fc1be189
3 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@
// Window that shows camera view and variety of info drawn on top
AnnotatedCameraWidget::AnnotatedCameraWidget(VisionStreamType type, QWidget* parent) : fps_filter(UI_FREQ, 3, 1. / UI_FREQ), CameraWidget("camerad", type, true, parent) {
pm = std::make_unique<PubMaster, const std::initializer_list<const char *>>({"uiDebug"});
pm = std::make_unique<PubMaster>(std::vector<const char*>{"uiDebug"});
main_layout = new QVBoxLayout(this);
main_layout->setMargin(UI_BORDER_SIZE);

View File

@ -37,7 +37,7 @@ Sidebar::Sidebar(QWidget *parent) : QFrame(parent), onroad(false), flag_pressed(
QObject::connect(uiState(), &UIState::uiUpdate, this, &Sidebar::updateState);
pm = std::make_unique<PubMaster, const std::initializer_list<const char *>>({"userFlag"});
pm = std::make_unique<PubMaster>(std::vector<const char*>{"userFlag"});
}
void Sidebar::mousePressEvent(QMouseEvent *event) {

View File

@ -240,7 +240,7 @@ void UIState::updateStatus() {
}
UIState::UIState(QObject *parent) : QObject(parent) {
sm = std::make_unique<SubMaster, const std::initializer_list<const char *>>({
sm = std::make_unique<SubMaster>(std::vector<const char*>{
"modelV2", "controlsState", "liveCalibration", "radarState", "deviceState",
"pandaStates", "carParams", "driverMonitoringState", "carState", "driverStateV2",
"wideRoadCameraState", "managerState", "clocks",