UI: Don't use draw objects from before a device loss

The system info screen's "Copy summary" kept the draw context it was
created with, and the GPU driver test screen kept its pipelines and
sampler, using and finally releasing them into a deleted context after
Android lost the surface. Look up the draw context when clicked, and
release the test objects on device loss (they're recreated on draw).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-26 15:04:00 +01:00
1 parent ac8440e35d
commit 247e764b97
3 files changed
+41 -48

No files matched your search

+1 -1
View File
@@ -129,7 +129,7 @@ void SystemInfoScreen::CreateDeviceInfoTab(UI::LinearLayout *deviceSpecs) {
Draw::DrawContext *draw = screenManager()->getDrawContext();
systemInfo->Add(new Choice(si->T("Copy summary to clipboard"), ImageID("I_FILE_COPY")))->OnClick.Add([draw](UI::EventParams &e) { CopySummaryToClipboard(draw); });
systemInfo->Add(new Choice(si->T("Copy summary to clipboard"), ImageID("I_FILE_COPY")))->OnClick.Add([this](UI::EventParams &e) { CopySummaryToClipboard(screenManager()->getDrawContext()); });
systemInfo->Add(new InfoItem(si->T("System Name"), System_GetProperty(SYSPROP_NAME)));
#if PPSSPP_PLATFORM(ANDROID)
systemInfo->Add(new InfoItem(si->T("System Version"), StringFromInt(System_GetPropertyInt(SYSPROP_SYSTEMVERSION))));