From d0a9fc3e35113e8734d10338856a43599f98d50c Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 17 Mar 2019 23:43:47 +0000 Subject: Fix IORequest duplication and ensure library bases are cleared when closed. --- frontends/amiga/libs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'frontends/amiga/libs.c') diff --git a/frontends/amiga/libs.c b/frontends/amiga/libs.c index cbef3c2fa..7de768b6a 100644 --- a/frontends/amiga/libs.c +++ b/frontends/amiga/libs.c @@ -113,7 +113,9 @@ #define AMINS_CLASS_CLOSE(PREFIX) \ if(I##PREFIX) DropInterface((struct Interface *)I##PREFIX); \ - if(PREFIX##Base) CloseClass(PREFIX##Base); + if(PREFIX##Base) CloseClass(PREFIX##Base); \ + I##PREFIX = NULL; \ + PREFIX##Base = NULL; #define AMINS_CLASS_STRUCT(PREFIX) \ struct ClassLibrary *PREFIX##Base = NULL; \ @@ -136,7 +138,8 @@ } #define AMINS_LIB_CLOSE(PREFIX) \ - if(PREFIX##Base) CloseLibrary((struct Library *)PREFIX##Base); + if(PREFIX##Base) CloseLibrary((struct Library *)PREFIX##Base); \ + PREFIX##Base = NULL; #define AMINS_LIB_STRUCT(PREFIX) \ struct PREFIX##Base *PREFIX##Base = NULL; @@ -156,7 +159,8 @@ } #define AMINS_CLASS_CLOSE(PREFIX) \ - if(PREFIX##Base) CloseLibrary(PREFIX##Base); + if(PREFIX##Base) CloseLibrary(PREFIX##Base); \ + PREFIX##Base = NULL; #define AMINS_CLASS_STRUCT(PREFIX) \ struct Library *PREFIX##Base = NULL; \ -- cgit v1.2.3