From b86be0d98fd078f656719c4ed3cffdbeca198ef3 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 17 Nov 2012 16:54:55 +0000 Subject: Fix account deletion on Windows by removing write lock before deleting files. --- bin/bbstoreaccounts/bbstoreaccounts.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bin/bbstoreaccounts/bbstoreaccounts.cpp') diff --git a/bin/bbstoreaccounts/bbstoreaccounts.cpp b/bin/bbstoreaccounts/bbstoreaccounts.cpp index 829f1a01..3f911b92 100644 --- a/bin/bbstoreaccounts/bbstoreaccounts.cpp +++ b/bin/bbstoreaccounts/bbstoreaccounts.cpp @@ -358,7 +358,7 @@ int DeleteAccount(Configuration &rConfig, int32_t ID, bool AskForConfirmation) return 1; } - // Back to original user, but write is maintained + // Back to original user, but write lock is maintained user.reset(); } @@ -403,6 +403,11 @@ int DeleteAccount(Configuration &rConfig, int32_t ID, bool AskForConfirmation) } } +#ifdef WIN32 + // Cannot remove files while holding a lock on them + writeLock.ReleaseLock(); +#endif + int retcode = 0; // Thirdly, delete the directories... -- cgit v1.2.3