From 187c0adaaec10a85b315fb12cb0251ddc5a56db2 Mon Sep 17 00:00:00 2001 From: Frode Solheim Date: Sat, 19 Sep 2015 11:37:17 +0200 Subject: [PATCH] JIT: Don't call uae_vm_free in LazyBlockAllocator destructor --- jit/compemu_support.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/jit/compemu_support.cpp b/jit/compemu_support.cpp index d0b8c0ef..984f3a9a 100644 --- a/jit/compemu_support.cpp +++ b/jit/compemu_support.cpp @@ -726,11 +726,20 @@ class LazyBlockAllocator T * mChunks; public: LazyBlockAllocator() : mPools(0), mChunks(0) { } +#ifdef UAE +#else ~LazyBlockAllocator(); +#endif T * acquire(); void release(T * const); }; +#ifdef UAE +/* uae_vm_release may do logging, which isn't safe to do when the application + * is shutting down. Better to release memory manually with a function call + * to a release_all method on shutdown, or even simpler, just let the OS + * handle it (we're shutting down anyway). */ +#else template< class T > LazyBlockAllocator::~LazyBlockAllocator() { @@ -741,6 +750,7 @@ LazyBlockAllocator::~LazyBlockAllocator() vm_release(deadPool, sizeof(Pool)); } } +#endif template< class T > T * LazyBlockAllocator::acquire() -- 2.47.3