Commit f3586994 by hendrikw Committed by Jamie Madill

angle: move DeallocateCurrent into windows only code

DeallocateCurrent is only called from within DllMain, which means it's only called on windows. On the mac, the warning unused-function may be triggered. Move DeallocateCurrent to windows only code. Change-Id: I61ba602af78d546a91cf009ae7350cf03eaa84dd Reviewed-on: https://chromium-review.googlesource.com/305880Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Tryjob-Request: Corentin Wallez <cwallez@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent e115c3be
...@@ -55,13 +55,6 @@ Current *AllocateCurrent() ...@@ -55,13 +55,6 @@ Current *AllocateCurrent()
return current; return current;
} }
void DeallocateCurrent()
{
Current *current = reinterpret_cast<Current*>(GetTLSValue(currentTLS));
SafeDelete(current);
SetTLSValue(currentTLS, NULL);
}
Current *GetCurrentData() Current *GetCurrentData()
{ {
// Create a TLS index if one has not been created for this DLL // Create a TLS index if one has not been created for this DLL
...@@ -78,6 +71,14 @@ Current *GetCurrentData() ...@@ -78,6 +71,14 @@ Current *GetCurrentData()
} }
#ifdef ANGLE_PLATFORM_WINDOWS #ifdef ANGLE_PLATFORM_WINDOWS
void DeallocateCurrent()
{
Current *current = reinterpret_cast<Current*>(GetTLSValue(currentTLS));
SafeDelete(current);
SetTLSValue(currentTLS, NULL);
}
extern "C" BOOL WINAPI DllMain(HINSTANCE, DWORD reason, LPVOID) extern "C" BOOL WINAPI DllMain(HINSTANCE, DWORD reason, LPVOID)
{ {
switch (reason) switch (reason)
......
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