From 01050b4415d1f7da5646621980a642c8808684c9 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 25 Jan 2015 01:12:45 +0000 Subject: Ensure we have the class pointer --- amiga/gui.c | 2 +- amiga/libs.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'amiga') diff --git a/amiga/gui.c b/amiga/gui.c index eb60b37d5..392873636 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -5188,7 +5188,7 @@ Object *ami_gui_splash_open(void) LOG(("WindowBase = %p", WindowBase)); LOG(("WindowObject = %p", win_obj)); - LOG(("BitMapBase = %p", BitMapBase)); + LOG(("BitMapClass = %p", BitMapClass)); LOG(("BitMapObject = %p", bm_obj)); LOG(("Attempting to open splash window...")); diff --git a/amiga/libs.c b/amiga/libs.c index da47010b5..42597f6ef 100644 --- a/amiga/libs.c +++ b/amiga/libs.c @@ -86,7 +86,8 @@ LOG(("Failed to get main interface v1 of %s", CLASS)); \ } \ } \ - } else { \ + } \ + if(PREFIX##Class == NULL) { \ STRPTR error = ASPrintf("Unable to open %s v%d (fatal error)", CLASS, CLASSVER); \ ami_misc_fatal_error(error); \ FreeVec(error); \ @@ -126,7 +127,8 @@ LOG(("Opening %s v%d", CLASS, CLASSVER)); \ if((PREFIX##Base = OpenLibrary(CLASS, CLASSVER))) { \ PREFIX##Class = CLASSGET##_GetClass(); \ - } else { \ + } \ + if(PREFIX##Class == NULL) { \ STRPTR error = ASPrintf("Unable to open %s v%d (fatal error)", CLASS, CLASSVER); \ ami_misc_fatal_error(error); \ FreeVec(error); \ @@ -137,8 +139,8 @@ if(PREFIX##Base) CloseLibrary(PREFIX##Base); #define AMINS_CLASS_STRUCT(PREFIX) \ - struct Library *PREFIX##Base; \ - Class *PREFIX##Class; + struct Library *PREFIX##Base = NULL; \ + Class *PREFIX##Class = NULL; #endif -- cgit v1.2.3