Commit 87bff28c authored by Andreas Mohr's avatar Andreas Mohr Committed by Alexandre Julliard

Flush current profile before using a newly opened one.

parent 3ee1c03e
...@@ -494,8 +494,10 @@ static BOOL PROFILE_Open( LPCSTR filename ) ...@@ -494,8 +494,10 @@ static BOOL PROFILE_Open( LPCSTR filename )
} }
} }
/* Rotate the oldest to the top to be replaced */ /* Flush the old current profile */
PROFILE_FlushFile();
/* Make the oldest profile the current one only in order to get rid of it */
if(i==N_CACHED_PROFILES) if(i==N_CACHED_PROFILES)
{ {
tempProfile=MRUProfile[N_CACHED_PROFILES-1]; tempProfile=MRUProfile[N_CACHED_PROFILES-1];
...@@ -503,11 +505,9 @@ static BOOL PROFILE_Open( LPCSTR filename ) ...@@ -503,11 +505,9 @@ static BOOL PROFILE_Open( LPCSTR filename )
MRUProfile[i]=MRUProfile[i-1]; MRUProfile[i]=MRUProfile[i-1];
CurProfile=tempProfile; CurProfile=tempProfile;
} }
/* Flush the profile */
if(CurProfile->filename) PROFILE_ReleaseFile(); if(CurProfile->filename) PROFILE_ReleaseFile();
/* OK, now that CurProfile is definitely free we assign it our new file */
newdos_name = HEAP_strdupA( SystemHeap, 0, full_name.short_name ); newdos_name = HEAP_strdupA( SystemHeap, 0, full_name.short_name );
CurProfile->dos_name = newdos_name; CurProfile->dos_name = newdos_name;
CurProfile->filename = HEAP_strdupA( SystemHeap, 0, filename ); CurProfile->filename = HEAP_strdupA( SystemHeap, 0, filename );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment