diff options
author | Viktor Mladenovski <viktor.mladenovski@stericsson.com> | 2011-05-20 14:10:59 +0200 |
---|---|---|
committer | Viktor Mladenovski <viktor.mladenovski@stericsson.com> | 2011-05-20 14:10:59 +0200 |
commit | f7e95217e936da34d7124aaced590692eb515923 (patch) | |
tree | 2d9ef4750a67d9d1dd3fe9180a4fef2929fad54b /source/LCDriverEntry.cpp |
Initial contribution of loader_communication
ST-Ericsson ID: 326913
ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10204
Change-Id: I171cfc2ee458a8a0a91a1916137d131f0f7ecee5
Diffstat (limited to 'source/LCDriverEntry.cpp')
-rw-r--r-- | source/LCDriverEntry.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/source/LCDriverEntry.cpp b/source/LCDriverEntry.cpp new file mode 100644 index 0000000..91bd189 --- /dev/null +++ b/source/LCDriverEntry.cpp @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (C) ST-Ericsson SA 2011 + * License terms: 3-clause BSD license + ******************************************************************************/ + +#include "LCDriverMethods.h" +#include "Buffers.h" + +void destroy(void); + +#ifdef _WIN32 +BOOL APIENTRY DllMain(HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved) +{ + switch (ul_reason_for_call) { + case DLL_PROCESS_ATTACH: + break; + case DLL_THREAD_ATTACH: + break; + case DLL_THREAD_DETACH: + break; + case DLL_PROCESS_DETACH: + destroy(); + break; + } + + return TRUE; +} +#else +void __attribute__((destructor)) DllMain(void) +{ + destroy(); +} +#endif + +//*********************************************************************************************** +// Name: destroy() +// Desc: Destroy any remaining buffer data. +//**********************************************************************************************/ +void destroy(void) +{ + Buffers::ReleaseAllBulkFiles(); + LcmInterface::CloseLCMLibrary(); +} |