Skip to content

Commit

Permalink
Qt: fix solar sensor menu regression (fixes #370)
Browse files Browse the repository at this point in the history
  • Loading branch information
fleroviux committed Apr 1, 2024
1 parent e83ea6c commit d672387
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/platform/qt/src/widget/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,8 +974,8 @@ void MainWindow::SetFullscreen(bool value) {
void MainWindow::UpdateSolarSensorLevel() {
auto level = config->cartridge.solar_sensor_level;

if(core) {
auto solar_sensor = core->GetROM().GetGPIODevice<nba::SolarSensor>();
if(core_not_thread_safe) {
nba::SolarSensor* solar_sensor = core_not_thread_safe->GetROM().GetGPIODevice<nba::SolarSensor>();

if(solar_sensor) {
solar_sensor->SetLightLevel(level);
Expand Down
2 changes: 1 addition & 1 deletion src/platform/qt/src/widget/main_window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private slots:

// The PPU debuggers do not access the core in a thread-safe way yet.
// So until that is fixed we have to keep a raw pointer around...
nba::CoreBase* core_not_thread_safe;
nba::CoreBase* core_not_thread_safe{};

QAction* pause_action;
InputWindow* input_window;
Expand Down

0 comments on commit d672387

Please sign in to comment.