IOS/WiiSockMan: Move instance to IOS Kernel. #11767
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was a global instance previously due to what seems to be legacy reasons.
I originally wanted to put this into one of the Network-related devices but there didn't seem to be a good single spot for it, so it just ended up in Kernel. I'm also not entirely sure why the Kernel uses
shared_ptr
for its device instances, can any of them actually outlive the Kernel itself? I've replicated this for the socket manager but I actually don't see any reason why it can't just be aunique_ptr
instead.@leoetlino Please review.
(As a side-note, I think I've noticed a logic error in the IOS savestating logic; nothing guarantees that devices in
m_device_map
are synced correctly with the ones in the savestate. You'd have to load a state from an IOS version than has different devices than the currently running one, which is unlikely in regular play, but I see nothing that actually prevents this...?)