mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Fixed several errors reported by Valgrind.
This commit is contained in:
parent
c2b3b029e5
commit
2768380446
10
INSTALL.md
10
INSTALL.md
|
@ -65,7 +65,15 @@ You can then profile the code with valgrind:
|
||||||
valgrind --tool=callgrind ./emulationstation
|
valgrind --tool=callgrind ./emulationstation
|
||||||
```
|
```
|
||||||
|
|
||||||
The output file from valgrind can be loaded into a tool such as KCachegrind for data analysis.
|
The output file can be loaded into a tool such as KCachegrind for data analysis.
|
||||||
|
|
||||||
|
To check for memory leaks, the following command is useful:
|
||||||
|
|
||||||
|
```
|
||||||
|
valgrind --tool=memcheck --leak-check=full ./emulationstation
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that you can also profile either a normal build or a debug build, but it's recommended to use the profiling build for reasons that is beyond the scope of this document.
|
||||||
|
|
||||||
To build ES with CEC support, add the corresponding option, for example:
|
To build ES with CEC support, add the corresponding option, for example:
|
||||||
|
|
||||||
|
|
|
@ -98,6 +98,13 @@ CollectionSystemManager::~CollectionSystemManager()
|
||||||
saveCustomCollection(it->second.system);
|
saveCustomCollection(it->second.system);
|
||||||
delete it->second.system;
|
delete it->second.system;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete the auto collections systems.
|
||||||
|
for (auto it = mAutoCollectionSystemsData.cbegin();
|
||||||
|
it != mAutoCollectionSystemsData.cend(); it++) {
|
||||||
|
delete (*it).second.system;
|
||||||
|
}
|
||||||
|
|
||||||
sInstance = nullptr;
|
sInstance = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,8 @@ GuiMetaDataEd::GuiMetaDataEd(
|
||||||
mMetaData(md),
|
mMetaData(md),
|
||||||
mSavedCallback(saveCallback),
|
mSavedCallback(saveCallback),
|
||||||
mClearGameFunc(clearGameFunc),
|
mClearGameFunc(clearGameFunc),
|
||||||
mDeleteGameFunc(deleteGameFunc)
|
mDeleteGameFunc(deleteGameFunc),
|
||||||
|
mMediaFilesUpdated(false)
|
||||||
{
|
{
|
||||||
addChild(&mBackground);
|
addChild(&mBackground);
|
||||||
addChild(&mGrid);
|
addChild(&mGrid);
|
||||||
|
|
|
@ -466,7 +466,7 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
bool splashScreen = Settings::getInstance()->getBool("SplashScreen");
|
bool splashScreen = Settings::getInstance()->getBool("SplashScreen");
|
||||||
bool splashScreenProgress = Settings::getInstance()->getBool("SplashScreenProgress");
|
bool splashScreenProgress = Settings::getInstance()->getBool("SplashScreenProgress");
|
||||||
SDL_Event event;
|
SDL_Event event {};
|
||||||
|
|
||||||
if (!window.init()) {
|
if (!window.init()) {
|
||||||
LOG(LogError) << "Window failed to initialize.";
|
LOG(LogError) << "Window failed to initialize.";
|
||||||
|
|
|
@ -16,6 +16,7 @@ SwitchComponent::SwitchComponent(
|
||||||
: GuiComponent(window),
|
: GuiComponent(window),
|
||||||
mImage(window),
|
mImage(window),
|
||||||
mState(state),
|
mState(state),
|
||||||
|
mOriginalValue(state),
|
||||||
mColorOriginalValue(DEFAULT_COLORSHIFT),
|
mColorOriginalValue(DEFAULT_COLORSHIFT),
|
||||||
mColorChangedValue(DEFAULT_COLORSHIFT)
|
mColorChangedValue(DEFAULT_COLORSHIFT)
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,6 +74,7 @@ VideoComponent::VideoComponent(
|
||||||
mGameLaunched(false),
|
mGameLaunched(false),
|
||||||
mBlockPlayer(false),
|
mBlockPlayer(false),
|
||||||
mTargetIsMax(false),
|
mTargetIsMax(false),
|
||||||
|
mFadeIn(1.0),
|
||||||
mTargetSize(0, 0)
|
mTargetSize(0, 0)
|
||||||
{
|
{
|
||||||
// Setup the default configuration.
|
// Setup the default configuration.
|
||||||
|
|
|
@ -108,7 +108,6 @@ protected:
|
||||||
unsigned mVideoHeight;
|
unsigned mVideoHeight;
|
||||||
Vector2f mTargetSize;
|
Vector2f mTargetSize;
|
||||||
std::shared_ptr<TextureResource> mTexture;
|
std::shared_ptr<TextureResource> mTexture;
|
||||||
float mFadeIn; // Used for fading in the video screensaver.
|
|
||||||
std::string mStaticImagePath;
|
std::string mStaticImagePath;
|
||||||
ImageComponent mStaticImage;
|
ImageComponent mStaticImage;
|
||||||
|
|
||||||
|
@ -125,6 +124,7 @@ protected:
|
||||||
bool mGameLaunched;
|
bool mGameLaunched;
|
||||||
bool mBlockPlayer;
|
bool mBlockPlayer;
|
||||||
bool mTargetIsMax;
|
bool mTargetIsMax;
|
||||||
|
float mFadeIn; // Used for fading in the video screensaver.
|
||||||
|
|
||||||
Configuration mConfig;
|
Configuration mConfig;
|
||||||
};
|
};
|
||||||
|
|
|
@ -51,10 +51,8 @@ static void display(void* /*data*/, void* /*id*/) {
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoVlcComponent::VideoVlcComponent(Window* window, std::string subtitles)
|
VideoVlcComponent::VideoVlcComponent(Window* window, std::string subtitles)
|
||||||
: VideoComponent(window), mMediaPlayer(nullptr)
|
: VideoComponent(window), mMediaPlayer(nullptr), mContext({})
|
||||||
{
|
{
|
||||||
memset(&mContext, 0, sizeof(mContext));
|
|
||||||
|
|
||||||
// Get an empty texture for rendering the video.
|
// Get an empty texture for rendering the video.
|
||||||
mTexture = TextureResource::get("");
|
mTexture = TextureResource::get("");
|
||||||
|
|
||||||
|
@ -65,6 +63,7 @@ VideoVlcComponent::VideoVlcComponent(Window* window, std::string subtitles)
|
||||||
VideoVlcComponent::~VideoVlcComponent()
|
VideoVlcComponent::~VideoVlcComponent()
|
||||||
{
|
{
|
||||||
stopVideo();
|
stopVideo();
|
||||||
|
mTexture.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoVlcComponent::setResize(float width, float height)
|
void VideoVlcComponent::setResize(float width, float height)
|
||||||
|
|
Loading…
Reference in a new issue