Skip to content
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

UICommon/ResourcePack: Minor cleanup #8127

merged 6 commits into from May 27, 2019


Copy link

lioncash commented May 27, 2019

Just performs some basic cleanups. Notably, the use of scope guards avoids resource leaks due to the file opened with unzOpen not having unzClose called on it in the failure paths. Also removes an unused variable in the closely related manager class.

lioncash added 6 commits May 27, 2019
Same behavior, only it doesn't unnecessarily store a pointer in the
executable. While we're at it, make it constexpr and move it into the
We can simply construct the containers with the desired size in these
A few cases duplicate the string patch creation, which is kind of
wasteful. We can just construct the string once.
Makes it way harder to introduce resource leaks, and plugs the existing
resource leaks in the constructor and Install() where the file wouldn't
be closed in some error cases.
…any contiguous container

This allows the same code to be used to read into a std::string, which
allows for eliminating the vector->string transfer when reading the
manifest file.

A ContiguousContainer is a concept that includes std::array,
std::string, and std::vector.


std::string manifest_contents(manifest_info.uncompressed_size, '\0');
if (!ReadCurrentFileUnlimited(file, manifest_contents))

This comment has been minimized.

Copy link

BhaaLseN May 27, 2019


Does this one handle a string parameter just fine?

This comment has been minimized.

Copy link

lioncash May 27, 2019

Author Member

It does indeed. It's the basis for the last commit in the PR.

@leoetlino leoetlino merged commit 800d875 into dolphin-emu:master May 27, 2019
10 checks passed
10 checks passed
default Very basic checks passed, handed off to Buildbot.
lint Build succeeded on builder lint
pr-android Build succeeded on builder pr-android
pr-deb-dbg-x64 Build succeeded on builder pr-deb-dbg-x64
pr-deb-x64 Build succeeded on builder pr-deb-x64
pr-freebsd-x64 Build succeeded on builder pr-freebsd-x64
pr-osx-x64 Build succeeded on builder pr-osx-x64
pr-ubu-x64 Build succeeded on builder pr-ubu-x64
pr-win-dbg-x64 Build succeeded on builder pr-win-dbg-x64
pr-win-x64 Build succeeded on builder pr-win-x64
@lioncash lioncash deleted the lioncash:resource branch May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.