LibCore: Don't print class_name() from EventReceiver::stop_timer()

If stop_timer() is called from ~EventReceiver(), then the virtual
functions will end up calling the overload from the base class. As
EventReceiver::class_name() is pure virtual, this calls
__cxa_pure_virtual and crashes. We should not be calling virtual
functions from the destructor, and especially not pure virtual ones.

This "fixes" a crash in Piano, but the root cause of the problem is
still unfixed.
This commit is contained in:
Andrew Kaster 2023-09-01 10:04:45 +02:00 committed by Andrew Kaster
parent 50bb785306
commit e6b8c2bd59
Notes: sideshowbarker 2024-07-17 06:33:00 +09:00

View File

@ -131,7 +131,7 @@ void EventReceiver::stop_timer()
return;
bool success = Core::EventLoop::unregister_timer(m_timer_id);
if (!success) {
dbgln("{} {:p} could not unregister timer {}", class_name(), this, m_timer_id);
dbgln("{:p} could not unregister timer {}", this, m_timer_id);
}
m_timer_id = 0;
}