From e6b8c2bd599a096a370abe98a0129d4e769bb87d Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Fri, 1 Sep 2023 10:04:45 +0200 Subject: [PATCH] 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. --- Userland/Libraries/LibCore/EventReceiver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibCore/EventReceiver.cpp b/Userland/Libraries/LibCore/EventReceiver.cpp index c06f27d5d0..ecba81c82b 100644 --- a/Userland/Libraries/LibCore/EventReceiver.cpp +++ b/Userland/Libraries/LibCore/EventReceiver.cpp @@ -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; }