Created attachment 130927 [details] simulate the actual switching mode case SUMMARY As switch different modes for one output or switch multioutput mode for two outputs. currentMode may pointer to undefined address after mode.erase() when calling OutputDevice::Private::addMode. switchmode.cpp is a test case to simulate the actual switching mode case in kde. STEPS TO REPRODUCE 1. switch different modes 2. call OutputDevice::pixelSize or OutputDevice::refreshRate 3. printf the values return by the api OBSERVED RESULT 1.sometimes get undefined values 2.sometimes crash EXPECTED RESULT get the correct currentMode values SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
I've submitted a patch here https://invent.kde.org/frameworks/kwayland/-/merge_requests/7