summaryrefslogtreecommitdiff
path: root/shared/recycler.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:09:24 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:09:24 +0200
commitb5f042a6c132c1b97cf03c4615bab966c23f57d2 (patch)
tree1cb057a0ffd51264bb3c9807e2133505ce312eb1 /shared/recycler.cpp
parent3.11 (diff)
downloadFreeFileSync-b5f042a6c132c1b97cf03c4615bab966c23f57d2.tar.gz
FreeFileSync-b5f042a6c132c1b97cf03c4615bab966c23f57d2.tar.bz2
FreeFileSync-b5f042a6c132c1b97cf03c4615bab966c23f57d2.zip
3.12
Diffstat (limited to 'shared/recycler.cpp')
-rw-r--r--shared/recycler.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/shared/recycler.cpp b/shared/recycler.cpp
index 31257a65..2ee23462 100644
--- a/shared/recycler.cpp
+++ b/shared/recycler.cpp
@@ -88,11 +88,13 @@ void moveToWindowsRecycler(const std::vector<Zstring>& filesToDelete) //throw (
using namespace fileop;
- static const MoveToRecycleBinFct moveToRecycler =
- util::getDllFun<MoveToRecycleBinFct>(getRecyclerDllName().c_str(), moveToRecycleBinFctName);
+ static MoveToRecycleBinFct moveToRecycler = NULL;
+ if (!moveToRecycler)
+ moveToRecycler = util::getDllFun<MoveToRecycleBinFct>(getRecyclerDllName().c_str(), moveToRecycleBinFctName);
- static const GetLastErrorFct getLastError =
- util::getDllFun<GetLastErrorFct>(getRecyclerDllName().c_str(), getLastErrorFctName);
+ static GetLastErrorFct getLastError = NULL;
+ if (!getLastError)
+ getLastError = util::getDllFun<GetLastErrorFct>(getRecyclerDllName().c_str(), getLastErrorFctName);
if (moveToRecycler == NULL || getLastError == NULL)
throw FileError(wxString(_("Error moving to Recycle Bin:")) + wxT("\n\"") + fileNames[0] + wxT("\"\n\n") + //report first file only... better than nothing
bgstack15