mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
Kernel: Fix GenericInterruptHandler problems with virtual functions
Because registering and unregistering interrupt handlers triggers calls to virtual functions, we can't do this in the constructor and destructor. Fixes #5539
This commit is contained in:
parent
183ebaee91
commit
32d9534c67
Notes:
sideshowbarker
2024-07-18 21:52:06 +09:00
Author: https://github.com/tomuta
Commit: 32d9534c67
Pull-request: https://github.com/SerenityOS/serenity/pull/5548
Issue: https://github.com/SerenityOS/serenity/issues/5539
11 changed files with 112 additions and 39 deletions
|
@ -38,12 +38,12 @@ namespace Kernel {
|
|||
|
||||
UNMAP_AFTER_INIT APICTimer* APICTimer::initialize(u8 interrupt_number, HardwareTimerBase& calibration_source)
|
||||
{
|
||||
auto* timer = new APICTimer(interrupt_number, nullptr);
|
||||
auto timer = adopt(*new APICTimer(interrupt_number, nullptr));
|
||||
timer->register_interrupt_handler();
|
||||
if (!timer->calibrate(calibration_source)) {
|
||||
delete timer;
|
||||
return nullptr;
|
||||
}
|
||||
return timer;
|
||||
return &timer.leak_ref();
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT APICTimer::APICTimer(u8 interrupt_number, Function<void(const RegisterState&)> callback)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue