mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-02 08:19:19 +00:00
AMIGAOS: Cleanup and free signals via atexit(), 2nd attempt
Second attempt at fixing #6956 "ScummVM returned with unfreed signals (AmigaOS4)" This only runs the cleanup code if the OSystem_AmigaOS instance has not been destroyed already.
This commit is contained in:
parent
198e346bf8
commit
926d5fd0b7
@ -27,7 +27,22 @@
|
||||
#include "backends/fs/amigaos/amigaos-fs-factory.h"
|
||||
#include "backends/dialogs/amigaos/amigaos-dialogs.h"
|
||||
|
||||
static bool cleanupDone = false;
|
||||
|
||||
static void cleanup() {
|
||||
if (!cleanupDone)
|
||||
g_system->destroy();
|
||||
}
|
||||
|
||||
OSystem_AmigaOS::~OSystem_AmigaOS() {
|
||||
cleanupDone = true;
|
||||
}
|
||||
|
||||
void OSystem_AmigaOS::init() {
|
||||
// Register cleanup function to avoid unfreed signals
|
||||
if (atexit(cleanup))
|
||||
warning("Failed to register cleanup function via atexit()");
|
||||
|
||||
// Initialize File System Factory
|
||||
_fsFactory = new AmigaOSFilesystemFactory();
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
class OSystem_AmigaOS : public OSystem_SDL {
|
||||
public:
|
||||
OSystem_AmigaOS() {}
|
||||
virtual ~OSystem_AmigaOS() {}
|
||||
virtual ~OSystem_AmigaOS();
|
||||
|
||||
bool hasFeature(Feature f) override;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user