From 7bd68501a1fce882b632ec43d7fc0b1d83c26e51 Mon Sep 17 00:00:00 2001 From: Tomas Jakobsson Date: Tue, 17 Oct 2017 22:05:12 +0200 Subject: [PATCH] Support FreeImage as a static library --- es-app/src/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/es-app/src/main.cpp b/es-app/src/main.cpp index 9f89b38d4..a64a1ad69 100644 --- a/es-app/src/main.cpp +++ b/es-app/src/main.cpp @@ -21,6 +21,7 @@ #include "ScraperCmdLine.h" #include #include +#include #ifdef WIN32 #include @@ -222,6 +223,11 @@ int main(int argc, char* argv[]) } #endif + // call this ONLY when linking with FreeImage as a static library +#ifdef FREEIMAGE_LIB + FreeImage_Initialise(); +#endif + //if ~/.emulationstation doesn't exist and cannot be created, bail if(!verifyHomeFolderExists()) return 1; @@ -384,6 +390,11 @@ int main(int argc, char* argv[]) CollectionSystemManager::deinit(); SystemData::deleteSystems(); + // call this ONLY when linking with FreeImage as a static library +#ifdef FREEIMAGE_LIB + FreeImage_DeInitialise(); +#endif + LOG(LogInfo) << "EmulationStation cleanly shutting down."; return 0;