mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05: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
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
|
|
|
@ -98,6 +98,13 @@ CollectionSystemManager::~CollectionSystemManager()
|
|||
saveCustomCollection(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;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,8 @@ GuiMetaDataEd::GuiMetaDataEd(
|
|||
mMetaData(md),
|
||||
mSavedCallback(saveCallback),
|
||||
mClearGameFunc(clearGameFunc),
|
||||
mDeleteGameFunc(deleteGameFunc)
|
||||
mDeleteGameFunc(deleteGameFunc),
|
||||
mMediaFilesUpdated(false)
|
||||
{
|
||||
addChild(&mBackground);
|
||||
addChild(&mGrid);
|
||||
|
|
|
@ -466,7 +466,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
bool splashScreen = Settings::getInstance()->getBool("SplashScreen");
|
||||
bool splashScreenProgress = Settings::getInstance()->getBool("SplashScreenProgress");
|
||||
SDL_Event event;
|
||||
SDL_Event event {};
|
||||
|
||||
if (!window.init()) {
|
||||
LOG(LogError) << "Window failed to initialize.";
|
||||
|
|
|
@ -16,6 +16,7 @@ SwitchComponent::SwitchComponent(
|
|||
: GuiComponent(window),
|
||||
mImage(window),
|
||||
mState(state),
|
||||
mOriginalValue(state),
|
||||
mColorOriginalValue(DEFAULT_COLORSHIFT),
|
||||
mColorChangedValue(DEFAULT_COLORSHIFT)
|
||||
{
|
||||
|
|
|
@ -74,6 +74,7 @@ VideoComponent::VideoComponent(
|
|||
mGameLaunched(false),
|
||||
mBlockPlayer(false),
|
||||
mTargetIsMax(false),
|
||||
mFadeIn(1.0),
|
||||
mTargetSize(0, 0)
|
||||
{
|
||||
// Setup the default configuration.
|
||||
|
|
|
@ -108,7 +108,6 @@ protected:
|
|||
unsigned mVideoHeight;
|
||||
Vector2f mTargetSize;
|
||||
std::shared_ptr<TextureResource> mTexture;
|
||||
float mFadeIn; // Used for fading in the video screensaver.
|
||||
std::string mStaticImagePath;
|
||||
ImageComponent mStaticImage;
|
||||
|
||||
|
@ -125,6 +124,7 @@ protected:
|
|||
bool mGameLaunched;
|
||||
bool mBlockPlayer;
|
||||
bool mTargetIsMax;
|
||||
float mFadeIn; // Used for fading in the video screensaver.
|
||||
|
||||
Configuration mConfig;
|
||||
};
|
||||
|
|
|
@ -51,10 +51,8 @@ static void display(void* /*data*/, void* /*id*/) {
|
|||
}
|
||||
|
||||
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.
|
||||
mTexture = TextureResource::get("");
|
||||
|
||||
|
@ -65,6 +63,7 @@ VideoVlcComponent::VideoVlcComponent(Window* window, std::string subtitles)
|
|||
VideoVlcComponent::~VideoVlcComponent()
|
||||
{
|
||||
stopVideo();
|
||||
mTexture.reset();
|
||||
}
|
||||
|
||||
void VideoVlcComponent::setResize(float width, float height)
|
||||
|
|
Loading…
Reference in a new issue