Skip to content

Commit

Permalink
fix: syncTimer's owner can't be null
Browse files Browse the repository at this point in the history
  • Loading branch information
VisualEhrmanntraut committed Dec 31, 2024
1 parent 153a831 commit c5f0d55
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ForgedInvariant/ForgedInvariant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ void ForgedInvariantMain::init() {

SYSLOG("Main", "No TSC_ADJUST or LockTscToCurrentP0 support, will have to sync TSC periodically.");

this->syncTimer = IOTimerEventSource::timerEventSource(nullptr, syncTscAction);
// We don't need an actual owner for the timer, just use some random OSObject, I guess...
// It fails if inOwner is nullptr. No other choice.
this->syncTimer = IOTimerEventSource::timerEventSource(kOSBooleanTrue, syncTscAction);
this->syncTimer->setTimeoutMS(PERIODIC_SYNC_INTERVAL);
}

0 comments on commit c5f0d55

Please sign in to comment.