Skip to content

Commit

Permalink
Fix fileset leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
xwidghet committed Jun 18, 2017
1 parent 1c612f8 commit 2c0385c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/RageUtil_FileDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,20 +441,15 @@ void FilenameDB::DelFileSet( map<RString, FileSet *>::iterator dir )

FileSet *fs = dir->second;

/* Remove any stale dirp pointers. */
/* Remove any stale dirp pointers. */
for( map<RString, FileSet *>::iterator it = dirs.begin(); it != dirs.end(); ++it )
{
if (it->first == dir->first)
FileSet *Clean = it->second;
for( set<File>::iterator f = Clean->files.begin(); f != Clean->files.end(); ++f )
{
FileSet *Clean = it->second;
for (set<File>::iterator f = Clean->files.begin(); f != Clean->files.end(); ++f)
{
File &ff = (File &)*f;
if (ff.dirp == fs)
File &ff = (File &) *f;
if( ff.dirp == fs )
ff.dirp = NULL;
}

break;
}
}

Expand Down

0 comments on commit 2c0385c

Please sign in to comment.