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

DolphinQt/Config/GameConfigEdit: Pass parent pointer to base class #8274

Merged
merged 1 commit into from Jul 31, 2019

Conversation

@lioncash
Copy link
Member

lioncash commented Jul 30, 2019

Previously, the constructor of GameConfigEdit wasn't doing anything with the passed in parent pointer. This is dangerous because it can result in memory being leaked in certain scenarios. It can also affect layout decisions made by the parent. Instead, pass it through to the base class.

Current usages of the class pass in nullptr as the parent, so this is a safe change to make with regards to the class hierarchy.

While we're at it, we can std::move the passed in QString into the class member, allowing calling code to move strings into the constructor, avoiding copies.

Previously, the constructor of GameConfigEdit wasn't doing anything with
the passed in parent pointer. This is dangerous because it can result in
memory being leaked in certain scenarios. It can also affect layout
decisions made by the parent. Instead, pass it through to the base class.

Current usages of the class pass in nullptr as the parent, so this is a
safe change to make with regards to the class hierarchy.

While we're at it, we can std::move the passed in QString into the class
member, allowing calling code to move strings into the constructor,
avoiding copies.
@leoetlino leoetlino merged commit c70da39 into dolphin-emu:master Jul 31, 2019
10 checks passed
10 checks passed
default Very basic checks passed, handed off to Buildbot.
Details
lint Build succeeded on builder lint
Details
pr-android Build succeeded on builder pr-android
Details
pr-deb-dbg-x64 Build succeeded on builder pr-deb-dbg-x64
Details
pr-deb-x64 Build succeeded on builder pr-deb-x64
Details
pr-freebsd-x64 Build succeeded on builder pr-freebsd-x64
Details
pr-osx-x64 Build succeeded on builder pr-osx-x64
Details
pr-ubu-x64 Build succeeded on builder pr-ubu-x64
Details
pr-win-dbg-x64 Build succeeded on builder pr-win-dbg-x64
Details
pr-win-x64 Build succeeded on builder pr-win-x64
Details
@lioncash lioncash deleted the lioncash:parent branch Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.