New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove GetSysDirectory spam #10703
Remove GetSysDirectory spam #10703
Conversation
75f9265
to
f5dfa2c
Compare
f5dfa2c
to
4174f0e
Compare
|
I made your suggested changes. |
3df0193
to
23a3ec5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this happens in practice, but on Android, s_android_sys_directory can be changed at any time, which would affect subsequent calls to GetSysDirectory(). Can we verify this on Android?
Otherwise seems fine to me.
|
It will change exactly once (from an empty string to a non-empty string). The assert that's in the code should catch any cases of GetSysDirectory being called before it changes. But we may want to add an additional assert to SetSysDirectory to ensure it never changes twice. |
Create and log path the first time GetSysDirectory is called, then just return the path on future calls.
23a3ec5
to
e0c9ae1
Compare
|
I've added the SetSysDirectory assert. |
Launching and then immediately closing Dolphin results in 51 (out of 81 total) lines of "Common\FileUtil.cpp:916 I[COMMON]: GetSysDirectory: Setting to [Dolphin Sys path]:". Most lines happen during startup and thus only show up in dolphin.log but 10 also appear in the log widget. Starting a game creates more such lines.
Unless I've misunderstood something the Sys path is constant for any given Dolphin session, and so there's no reason to recreate it each time GetSysDirectory is called.
This PR creates and logs the Sys directory path once, and also does some minor refactoring and removes the extraneous colon at the end of the line.