do not use invalid Directory instance (OSL_ASSERT about a NULL pointer)

Change-Id: Icc1dffc9b63453575ab927a3bdfa4b25cecfe8f2
This commit is contained in:
Luboš Luňák
2012-09-19 15:22:26 +02:00
parent d6203d8d92
commit b53472db03

View File

@@ -20,15 +20,17 @@ void TemporaryFonts::clear()
rtl::Bootstrap::expandMacros( path );
path += "/user/temp/fonts/";
osl::Directory dir( path );
dir.reset();
for(;;)
if( dir.reset() == osl::Directory::E_None )
{
osl::DirectoryItem item;
if( dir.getNextItem( item ) != osl::Directory::E_None )
break;
osl::FileStatus status( osl_FileStatus_Mask_FileURL );
if( item.getFileStatus( status ) == osl::File::E_None )
osl::File::remove( status.getFileURL());
for(;;)
{
osl::DirectoryItem item;
if( dir.getNextItem( item ) != osl::Directory::E_None )
break;
osl::FileStatus status( osl_FileStatus_Mask_FileURL );
if( item.getFileStatus( status ) == osl::File::E_None )
osl::File::remove( status.getFileURL());
}
}
}