Flush current profile before using a newly opened one.
diff --git a/files/profile.c b/files/profile.c
index 654b1f3..a09ed95 100644
--- a/files/profile.c
+++ b/files/profile.c
@@ -494,8 +494,10 @@
}
}
- /* 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)
{
tempProfile=MRUProfile[N_CACHED_PROFILES-1];
@@ -503,11 +505,9 @@
MRUProfile[i]=MRUProfile[i-1];
CurProfile=tempProfile;
}
-
- /* Flush the profile */
-
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 );
CurProfile->dos_name = newdos_name;
CurProfile->filename = HEAP_strdupA( SystemHeap, 0, filename );