diff --git a/src/main.c b/src/main.c index 2e6f1ec45004336e8d07c39267005785e0a64d56..d88e218385a616ca4e7ed70a401d9b48e7ff1403 100644 --- a/src/main.c +++ b/src/main.c @@ -1522,8 +1522,11 @@ int main(int argc, char *argv[]) printf("Terminating!\n"); te4_web_terminate(); + printf("Webcore shutdown complete\n"); SDL_Quit(); + printf("SDL shutdown complete\n"); deinit_openal(); + printf("OpenAL shutdown complete\n"); printf("Thanks for having fun!\n"); #ifdef SELFEXE_WINDOWS diff --git a/src/web-cef3/build/windows/build.bat b/src/web-cef3/build/windows/build.bat index dcfea2b98774b2e7da1b1662148c6eb7b7ad006c..beb5eff211a6a54f0b1c7e1bcee717ddaecc2c3f 100644 --- a/src/web-cef3/build/windows/build.bat +++ b/src/web-cef3/build/windows/build.bat @@ -12,6 +12,8 @@ @set CXX=cl @set CXXFLAGS=/nologo /MT /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /EHsc /DSELFEXE_WINDOWS @rem @set CXXFLAGS=/nologo /MT /Od /Zi /Wall /D_CRT_SECURE_NO_DEPRECATE /EHsc +@set SPAWNNAME=cef3spawn.exe +@set SPAWN_C=spawn.cpp @set DLLNAME=te4-web.dll @set LIBNAME=te4-web.lib @set TE4_WEB_C=web.cpp web-utils.cpp @@ -20,6 +22,8 @@ %CXX% %CXXFLAGS% /LD /Fe%DLLNAME% %TE4_WEB_INCLUDES% %TE4_WEB_C% %TE4_WEB_LIBS% +%CXX% %CXXFLAGS% /Fe%SPAWNNAME% %TE4_WEB_INCLUDES% %SPAWN_C% %TE4_WEB_LIBS% + @if errorlevel 1 goto :COMPILATION_ERROR @rem All done. diff --git a/src/web-cef3/spawn.cpp b/src/web-cef3/spawn.cpp index 92a6a87bed5886a7e56f3098eb6d8d834a80199e..9855c6fbf468dc8fdeb17c22b0a7102b2f42f6ea 100644 --- a/src/web-cef3/spawn.cpp +++ b/src/web-cef3/spawn.cpp @@ -19,6 +19,10 @@ darkgod@te4.org */ +#ifdef _WIN32 +#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") +#endif + extern "C" { #include "web-external.h" #include <stdio.h> diff --git a/src/web-cef3/web.cpp b/src/web-cef3/web.cpp index bfe9de3ea3d8351f3d147d908a64581fd87e8b7e..a856da6456ce339d87bb535692f3d610e94f379d 100644 --- a/src/web-cef3/web.cpp +++ b/src/web-cef3/web.cpp @@ -870,7 +870,9 @@ void te4_web_shutdown() { all[it->first] = it->second; } + fprintf(logfile, "[WEBCORE] Sending kill to all browsers (%d)\n", all_browsers_nb); for (std::map<BrowserClient*, bool>::iterator it=all.begin(); it != all.end(); ++it) { + fprintf(logfile, "[WEBCORE] Sending kill to a browser (crash status %d)\n", it->first->opaque->crashed); if (!it->first->opaque->crashed) { it->first->browser->GetHost()->CloseBrowser(true); } @@ -880,7 +882,10 @@ void te4_web_shutdown() { CefDoMessageLoopWork(); fprintf(logfile, "Waiting browsers to close: %d left\n", all_browsers.size()); } + + fprintf(logfile, "[WEBCORE] all browsers dead, shutting down\n"); CefShutdown(); + fprintf(logfile, "[WEBCORE] all browsers dead, shutdown completed\n"); fclose(logfile); }