don't dlclose gamestates when running on valgrind, so it can show its report correctly

This commit is contained in:
Sebastian Krzyszkowiak 2016-08-27 00:46:38 +02:00
parent 04db328028
commit b4d9d01c01
2 changed files with 7130 additions and 3 deletions

7126
src/3rdparty/valgrind.h vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -28,12 +28,13 @@
#include <dlfcn.h>
#include <unistd.h>
#include <libgen.h>
#include "internal.h"
#include "libsuperderpy.h"
#include "3rdparty/valgrind.h"
#ifdef ALLEGRO_MACOSX
#include <mach-o/dyld.h>
#include <sys/param.h>
#endif
#include "internal.h"
#include "libsuperderpy.h"
SYMBOL_EXPORT struct Game* libsuperderpy_init(int argc, char** argv, const char* name, struct libsuperderpy_viewport viewport) {
@ -440,7 +441,7 @@ SYMBOL_EXPORT void libsuperderpy_destroy(struct Game *game) {
(*tmp->api->Gamestate_Unload)(game, tmp->data);
tmp->loaded = false;
}
if (tmp->handle) {
if (tmp->handle && !RUNNING_ON_VALGRIND) {
PrintConsole(game, "Closing gamestate \"%s\"...", tmp->name);
dlclose(tmp->handle);
}