VBCC crash on CloseCatalog() [AUTO-SOLVED]

4 posts / 0 new
Last post
jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
VBCC crash on CloseCatalog() [AUTO-SOLVED]

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:

  1. li.li_Catalog = NULL;
  2. if( (LocaleBase=OpenLibrary("locale.library", 52)) )
  3. {
  4. OPENIFACE(Locale)
  5. #ifdef __amigaos4__
  6. li.li_ILocale = ILocale;
  7. #else
  8. li.li_LocaleBase = LocaleBase;
  9. #endif
  10. li.li_Catalog = OpenCatalog(NULL, "amigemini.catalog",
  11. OC_BuiltInLanguage, "english",
  12. OC_PreferExternal, TRUE,
  13. TAG_END);
  14. }
  15. //else { PutErrStr("Failed to use catalog system. Using built-in strings.\n"); }
  16. DBUG("li_Catalog=0x%08lx\n",li.li_Catalog);
  17. ...
  18. if (LocaleBase) {
  19. DBUG("li_Catalog=0x%08lx\n",li.li_Catalog);
  20. if(li.li_Catalog) { CloseCatalog(li.li_Catalog); }
  21. CLOSEIFACE(Locale);
  22. CloseLibrary( (struct Library *)LocaleBase );
  23. }
  24. ...

and I get always the crash on CloseCatalog:
[file.c:122 ] li_Catalog=0x5a461ca0
[file.c:266 ] li_Catalog=0x5a461ca0

Any idea. TIA

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
Re: VBCC crash on CloseCatalog()

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

hypex
hypex's picture
Offline
Last seen: 4 months 2 weeks ago
Joined: 2011-09-09 16:20
Re: VBCC crash on CloseCatalog() [AUTO-SOLVED]

Good. You got it. You might want to move your OPENIFACE down below the ifdef since only OS4 needs it.

jabirulo
jabirulo's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 2013-05-30 00:53
Re: VBCC crash on CloseCatalog() [AUTO-SOLVED]

Alreay thought about that, but alas is a define:

#ifdef __amigaos4__
#define ARCH "OS4"
...
#define CLOSEIFACE(iface) \
{ DropInterface((struct Interface *)I##iface); I##iface = NULL; }
...
#else
#include
// NewList

#define ARCH "68K"

#define OPENIFACE(iface)
#define CLOSEIFACE(iface)

#endif

AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P

Log in or register to post comments