Processes can keep some Thread/Timer object alive while the manager is already destructed, resulting use-after-free in Thread::Stop and Timer::dtor. To resolve this, the manager objects should be destructed after all related object destructed.
Fixes a bug where quiting citra causes crash while the game is using a Timer.
Fix a warning where class definition and forward declaration mismatch. CodeSet is a kernel object and have ctor/dtor/private members like others, so in convention it should be a class
To obtain the data, the LLEd mii selector of system version 11.8.0 was used.
In AppletManager::GlanceParameter, the following code was added to write the returned buffer data to a file:
if (parameter.buffer.size() == 132) {
std::u16string name(10, '\0');
std::memcpy(name.data(), parameter.buffer.data() + 0x26, 10 * sizeof(u16));
name = std::u16string(name.data());
FileUtil::IOFile file{fmt::format("{}.mii", Common::UTF16ToUTF8(name)), "wb"};
file.WriteBytes(parameter.buffer.data(), parameter.buffer.size());
}
Then "xxd -i" was used on the file to convert it to a hex array.
* FileSys/DelayGenerator: add missing #include and virtual dtor
Added the needed include so that it won't cause error if another file includes this without including the depended files
Deleting a virtual class via base type without virtual dtor is UB, which happens inFileBackend.
* FileSys/DelayGenerator: move function definition into cpp file/n/nTo avoid generating vtable in all units that includes the header file
* filesys/delay_generator: rearrange #include
tr() will not function properly on static/global data like this, as the
object is only ever constructed once, so the strings won't translate if
the language is changed without restarting the program, which is
undesirable. Instead we can just turn the map into a plain old function
that maps the values to their equivalent strings. This is also lessens
the memory allocated, since it's only allocating memory for the strings
themselves, and not an encompassing map as well.
This is more localized to what we want to enforce directory-wise with
the project. CMAKE_SOURCE_DIR indicates the root of the source tree, but
this would cause the wrong behavior if someone included yuzu as part of
a larger buildsystem (for whatever reason). Instead, we want to use the
directory where the "project(yuzu)" command was declared as the root
path reference.
These should be initialized to deterministic values so it's easier to
catch improper behavior, as it'll always be reproducable, instead of
performing uninitialized reads.
These are only used within this class, so we can make them private to
keep their use contained. This also gets rid of the pre-Qt5 'slot'
identifier, since Qt 5's connection syntax doesn't require a function to
be declared a slot anymore.
This gets rid of an unnecessary type conversion. We can just use the
regular QStringLiteral to already format the string as the type
setWindowTitle accepts instead of converting from a std::string
instance.
This was only ever used by the now-removed memory_util functions. Also,
given we don't plan to support 32-bit architectures, this is just a
leftover from citra at this point.
Everything from here is completely unused and also written with the
notion of supporting 32-bit architecture variants in mind. Given the
Switch itself is on a 64-bit architecture, we won't be supporting 32-bit
architectures. If we need specific allocation functions in the future,
it's likely more worthwhile to new functions for that purpose.