Переглянути джерело

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.
Andrew Kaster 1 рік тому
батько
коміт
e6b8c2bd59
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      Userland/Libraries/LibCore/EventReceiver.cpp

+ 1 - 1
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;
 }