From b9785e33e75a9aed1aff579ecbd2665fb42201aa Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 27 Jul 2024 23:26:16 -0400 Subject: [PATCH] use sp's --- selfdrive/ui/qt/maps/map_panel.cc | 1 + selfdrive/ui/sunnypilot/qt/maps/map.cc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/selfdrive/ui/qt/maps/map_panel.cc b/selfdrive/ui/qt/maps/map_panel.cc index 4f92c98482..cd448483ff 100644 --- a/selfdrive/ui/qt/maps/map_panel.cc +++ b/selfdrive/ui/qt/maps/map_panel.cc @@ -8,6 +8,7 @@ #ifdef SUNNYPILOT #include "selfdrive/ui/sunnypilot/ui.h" #include "selfdrive/ui/sunnypilot/qt/maps/map.h" +#define MapWindow MapWindowSP #else #include "selfdrive/ui/ui.h" #include "selfdrive/ui/qt/maps/map.h" diff --git a/selfdrive/ui/sunnypilot/qt/maps/map.cc b/selfdrive/ui/sunnypilot/qt/maps/map.cc index 7cb4a77539..9ce1236a91 100644 --- a/selfdrive/ui/sunnypilot/qt/maps/map.cc +++ b/selfdrive/ui/sunnypilot/qt/maps/map.cc @@ -8,6 +8,10 @@ MapWindowSP::MapWindowSP(const QMapLibre::Settings &settings) : MapWindow(settin QObject::connect(uiStateSP(), &UIStateSP::uiUpdate, this, &MapWindowSP::updateState); } +MapWindowSP::~MapWindowSP() { + makeCurrent(); +} + void MapWindowSP::initLayers() { if (!m_map->layerExists("navLayer")) { m_map->setPaintProperty("navLayer", "line-color", getNavPathColor(uiStateSP()->scene.navigate_on_openpilot_deprecated));