core_timing: Use better reference tracking for EventType. (#3159)
* core_timing: Use better reference tracking for EventType. - Moves ownership of the event to the caller, ensuring we don't fire events for destroyed objects. - Removes need for unique names - we won't be using this for save states anyways.
This commit is contained in:
parent
31daaa7911
commit
ec0ce96c56
17 changed files with 103 additions and 161 deletions
|
@ -37,8 +37,8 @@ NVFlinger::NVFlinger(Core::System& system) : system(system) {
|
|||
displays.emplace_back(4, "Null", system);
|
||||
|
||||
// Schedule the screen composition events
|
||||
composition_event = system.CoreTiming().RegisterEvent(
|
||||
"ScreenComposition", [this](u64 userdata, s64 cycles_late) {
|
||||
composition_event =
|
||||
Core::Timing::CreateEvent("ScreenComposition", [this](u64 userdata, s64 cycles_late) {
|
||||
Compose();
|
||||
const auto ticks =
|
||||
Settings::values.force_30fps_mode ? frame_ticks_30fps : GetNextTicks();
|
||||
|
|
|
@ -103,7 +103,7 @@ private:
|
|||
u32 swap_interval = 1;
|
||||
|
||||
/// Event that handles screen composition.
|
||||
Core::Timing::EventType* composition_event;
|
||||
std::shared_ptr<Core::Timing::EventType> composition_event;
|
||||
|
||||
Core::System& system;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue