1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 18:59:09 +00:00

Add support for Visual Leak Detector, since valgrind doesn't support MSVC

This commit is contained in:
2012-11-18 20:38:55 -08:00
parent 49dfb4e546
commit 9f276e2c57
26 changed files with 146 additions and 10 deletions

View File

@ -178,6 +178,10 @@ if(Bink_SDK_AVAILABLE)
target_link_libraries(plClient ${Bink_LIBRARIES})
endif()
if(USE_VLD)
target_link_libraries(plClient ${VLD_LIBRARY})
endif()
if (WIN32)
target_link_libraries(plClient Rpcrt4)
target_link_libraries(plClient Version)

View File

@ -945,6 +945,10 @@ static size_t CurlCallback(void *buffer, size_t size, size_t nmemb, void *param)
void StatusCallback(void *param)
{
#ifdef USE_VLD
VLDEnable();
#endif
HWND hwnd = (HWND)param;
const char *statusUrl = GetServerStatusUrl();

View File

@ -20,5 +20,9 @@ set(plClientPatcher_SOURCES
add_library(plClientPatcher STATIC ${plClientPatcher_HEADERS} ${plClientPatcher_SOURCES})
target_link_libraries(plClientPatcher CoreLib plAudioCore plStatusLog)
if(USE_VLD)
target_link_libraries(plClientPatcher ${VLD_LIBRARY})
endif()
source_group("Header Files" FILES ${plClientPatcher_HEADERS})
source_group("Source Files" FILES ${plClientPatcher_SOURCES})

View File

@ -264,6 +264,10 @@ static void NetErrorHandler (ENetProtocol protocol, ENetError error) {
/*
//============================================================================
static void WaitUruExitProc (void * param) {
#ifdef USE_VLD
VLDEnable();
#endif
plLauncherInfo *info = (plLauncherInfo *) param;
WaitForSingleObject(s_pi.hProcess, INFINITE);
DWORD exitcode;
@ -539,6 +543,10 @@ static void ProcessManifestEntry (void * param, ENetError error) {
//============================================================================
static void ProcessManifest (void * param) {
#ifdef USE_VLD
VLDEnable();
#endif
wchar_t basePath[MAX_PATH];
char path[MAX_PATH];
AtomicAdd(&s_perf[kPerfThreadTaskCount], 1);
@ -885,6 +893,10 @@ void ShutdownAsyncCore () {
//============================================================================
// param = URU_PreparationRequest
void UruPrepProc (void * param) {
#ifdef USE_VLD
VLDEnable();
#endif
s_running = true;
plLauncherInfo *info = (plLauncherInfo *) param;
@ -952,6 +964,10 @@ void UruPrepProc (void * param) {
//============================================================================
void PlayerStopProc (void * param) {
#ifdef USE_VLD
VLDEnable();
#endif
s_running = false;
plLauncherInfo *info = (plLauncherInfo *) param;
//TerminateProcess(s_pi.hProcess, kExitCodeTerminated);
@ -960,6 +976,10 @@ void PlayerStopProc (void * param) {
//============================================================================
void PlayerTerminateProc (void * param) {
#ifdef USE_VLD
VLDEnable();
#endif
s_running = false;
plLauncherInfo *info = (plLauncherInfo *) param;
ShutdownAsyncCore();
@ -968,6 +988,10 @@ void PlayerTerminateProc (void * param) {
//============================================================================
void UruStartProc (void * param) {
#ifdef USE_VLD
VLDEnable();
#endif
if(!s_running)
return;

View File

@ -15,7 +15,11 @@ target_link_libraries(plCrashHandler pfCrashHandler)
target_link_libraries(plCrashHandler plFile)
target_link_libraries(plCrashHandler pnProduct)
if(USE_VLD)
target_link_libraries(plCrashHandler ${VLD_LIBRARY})
endif()
# Platform specific libs
if(WIN32)
target_link_libraries(plCrashHandler Dbghelp)
target_link_libraries(plCrashHandler Dbghelp)
endif(WIN32)

View File

@ -14,4 +14,8 @@ set(plFileEncrypt_SOURCES
add_executable(plFileEncrypt ${plFileEncrypt_SOURCES})
target_link_libraries(plFileEncrypt CoreLib pnProduct plFile)
if(USE_VLD)
target_link_libraries(plFileEncrypt ${VLD_LIBRARY})
endif()
source_group("Source Files" FILES ${plFileEncrypt_SOURCES})

View File

@ -14,4 +14,8 @@ set(plFileSecure_SOURCES
add_executable(plFileSecure ${plFileSecure_SOURCES})
target_link_libraries(plFileSecure CoreLib pnProduct plFile)
if(USE_VLD)
target_link_libraries(plFileSecure ${VLD_LIBRARY})
endif()
source_group("Source Files" FILES ${plFileSecure_SOURCES})

View File

@ -16,4 +16,8 @@ add_executable(plMD5 ${plMD5_SOURCES})
target_link_libraries(plMD5 CoreLib pnUtils pnProduct pnEncryption)
target_link_libraries(plMD5 ${OPENSSL_LIBRARIES})
if(USE_VLD)
target_link_libraries(plMD5 ${VLD_LIBRARY})
endif()
source_group("Source Files" FILES ${plMD5_SOURCES})

View File

@ -15,4 +15,8 @@ set(plPageInfo_SOURCES
add_executable(plPageInfo ${plPageInfo_SOURCES})
target_link_libraries(plPageInfo CoreLib pnProduct plResMgr plAudioCore)
if(USE_VLD)
target_link_libraries(plPageInfo ${VLD_LIBRARY})
endif()
source_group("Source Files" FILES ${plPageInfo_SOURCES})

View File

@ -22,5 +22,9 @@ else()
target_link_libraries(plPythonPack ${PYTHON_LIBRARY})
endif()
if(USE_VLD)
target_link_libraries(plPythonPack ${VLD_LIBRARY})
endif()
source_group("Source Files" FILES ${plPythonPack_SOURCES})
source_group("Header Files" FILES ${plPythonPack_HEADERS})

View File

@ -16,4 +16,8 @@ add_executable(plSHA ${plSHA_SOURCES})
target_link_libraries(plSHA CoreLib pnUtils pnProduct pnEncryption)
target_link_libraries(plSHA ${OPENSSL_LIBRARIES})
if(USE_VLD)
target_link_libraries(plSHA ${VLD_LIBRARY})
endif()
source_group("Source Files" FILES ${plSHA_SOURCES})

View File

@ -65,6 +65,10 @@ target_link_libraries(plUruLauncher ws2_32)
target_link_libraries(plUruLauncher rpcrt4)
target_link_libraries(plUruLauncher comctl32)
if(USE_VLD)
target_link_libraries(plUruLauncher ${VLD_LIBRARY})
endif()
source_group("Source Files" FILES ${plUruLauncher_SOURCES})
source_group("Header Files" FILES ${plUruLauncher_HEADERS})
source_group("Resource Files" FILES ${plUruLauncher_RESOURCES})

View File

@ -431,6 +431,9 @@ BOOL CALLBACK SplashDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
//============================================================================
static void WindowThreadProc(void *) {
#ifdef USE_VLD
VLDEnable();
#endif
InitCommonControls();
s_event = CreateEvent(
@ -476,6 +479,10 @@ static size_t CurlCallback(void *buffer, size_t size, size_t nmemb, void *)
//============================================================================
static void StatusCallback(void *)
{
#ifdef USE_VLD
VLDEnable();
#endif
const char *serverUrl = GetServerStatusUrl();
CURL * hCurl = curl_easy_init();