using VBCC to build OS4 program I get a crash on CloseCatalog().
CATCOMP file.cd CFILE locale_file.h
and in main.c I have:
li.li_Catalog = NULL; if( (LocaleBase=OpenLibrary("locale.library", 52)) ) { OPENIFACE(Locale) #ifdef __amigaos4__ li.li_ILocale = ILocale; #else li.li_LocaleBase = LocaleBase; #endif li.li_Catalog = OpenCatalog(NULL, "amigemini.catalog", OC_BuiltInLanguage, "english", OC_PreferExternal, TRUE, TAG_END); } //else { PutErrStr("Failed to use catalog system. Using built-in strings.\n"); } DBUG("li_Catalog=0x%08lx\n",li.li_Catalog); ... if (LocaleBase) { DBUG("li_Catalog=0x%08lx\n",li.li_Catalog); if(li.li_Catalog) { CloseCatalog(li.li_Catalog); } CLOSEIFACE(Locale); CloseLibrary( (struct Library *)LocaleBase ); } ...
and I get always the crash on CloseCatalog:
[file.c:122 ] li_Catalog=0x5a461ca0
[file.c:266 ] li_Catalog=0x5a461ca0
Any idea. TIA
And the solution is NOT to close lib/IFace X-P just before calling CloseCatalog()
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P
Good. You got it. You might want to move your OPENIFACE down below the ifdef since only OS4 needs it.
Alreay thought about that, but alas is a define:
#ifdef __amigaos4__
// NewList
#define ARCH "OS4"
...
#define CLOSEIFACE(iface) \
{ DropInterface((struct Interface *)I##iface); I##iface = NULL; }
...
#else
#include
#define ARCH "68K"
#define OPENIFACE(iface)
#define CLOSEIFACE(iface)
#endif
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P