Fix for mismatched fceu.cpp free()/malloc() error flagged by valgrind.

This commit is contained in:
mjbudd77 2021-02-21 21:04:02 -05:00
parent 3d2d3cbf26
commit bf17e53335
1 changed files with 14 additions and 10 deletions

View File

@ -120,19 +120,23 @@ char romNameWhenClosingEmulator[2048] = {0};
FCEUGI::FCEUGI()
: filename(0),
archiveFilename(0) {
archiveFilename(0)
{
//printf("%08x",opsize); // WTF?!
}
FCEUGI::~FCEUGI() {
if (filename) {
free(filename);
filename = NULL;
}
if (archiveFilename) {
delete archiveFilename;
archiveFilename = NULL;
}
FCEUGI::~FCEUGI()
{
if (filename)
{
free(filename);
filename = NULL;
}
if (archiveFilename)
{
free(archiveFilename);
archiveFilename = NULL;
}
}
bool CheckFileExists(const char* filename) {