Skip to content

Commit 2c0385c

Browse files
committed
Fix fileset leak.
1 parent 1c612f8 commit 2c0385c

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/RageUtil_FileDB.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -441,20 +441,15 @@ void FilenameDB::DelFileSet( map<RString, FileSet *>::iterator dir )
441441

442442
FileSet *fs = dir->second;
443443

444-
/* Remove any stale dirp pointers. */
444+
/* Remove any stale dirp pointers. */
445445
for( map<RString, FileSet *>::iterator it = dirs.begin(); it != dirs.end(); ++it )
446446
{
447-
if (it->first == dir->first)
447+
FileSet *Clean = it->second;
448+
for( set<File>::iterator f = Clean->files.begin(); f != Clean->files.end(); ++f )
448449
{
449-
FileSet *Clean = it->second;
450-
for (set<File>::iterator f = Clean->files.begin(); f != Clean->files.end(); ++f)
451-
{
452-
File &ff = (File &)*f;
453-
if (ff.dirp == fs)
450+
File &ff = (File &) *f;
451+
if( ff.dirp == fs )
454452
ff.dirp = NULL;
455-
}
456-
457-
break;
458453
}
459454
}
460455

0 commit comments

Comments
 (0)