[comp.sys.atari.st] 3 bombs

jimomura@lsuc.on.ca (Jim Omura) (05/08/91)

     I've been working on a program for a few months now and it's got
one "last" problem that I can't fix.  I've been staring at it off and
on for months now.  The program is graphics oriented using GEM calls.
As far as I know I've done everything I need to do for a "clean exit"
back to the desktop.  But I still get 3 bombs when it returns to
the desktop.  Functionally the program is usable as-is.  But I don't
like the idea of marketting a product that bombs on exit.  I've
compiled the program with Sozobon C and I was wonder if this is a
specific problem with Sozobon.  Or is there something I don't know
about exiting from GEM?

-- 
Jim Omura, 2A King George's Drive, Toronto, (416) 652-3880
lsuc!jimomura
Byte Information eXchange: jimomura

dmb@wam.umd.edu (David M. Baggett) (05/08/91)

In article <1991May7.231318.12305@lsuc.on.ca> jimomura@lsuc.on.ca (Jim Omura) writes:
>
>     I've been working on a program for a few months now and it's got
>one "last" problem that I can't fix.  I've been staring at it off and
>on for months now.  The program is graphics oriented using GEM calls.
>As far as I know I've done everything I need to do for a "clean exit"
>back to the desktop.  But I still get 3 bombs when it returns to
>the desktop.  Functionally the program is usable as-is.  But I don't
>like the idea of marketting a product that bombs on exit.  I've
>compiled the program with Sozobon C and I was wonder if this is a
>specific problem with Sozobon.  Or is there something I don't know
>about exiting from GEM?

I had exactly this problem with a GEM application I wrote several years
ago.  In my case, it turned out that one of my menus was too large.  I
think it was 15 lines by 30 characters, which was evidently too big for
GEM to handle.  Making the menu one character shorter fixed it.
(Technically speaking, the "rule" is that menus can't be bigger than
1/4th of the screen.  My menu didn't look that big on the screen.)

Dave Baggett
dmb%wam.umd.edu@uunet.uu.net

jimomura@lsuc.on.ca (Jim Omura) (05/10/91)

In article <1991May7.231318.12305@lsuc.on.ca> jimomura@lsuc.on.ca (Jim Omura) writes:
>
>     I've been working on a program for a few months now and it's got
>one "last" problem that I can't fix.  I've been staring at it off and
>on for months now.  The program is graphics oriented using GEM calls.
>As far as I know I've done everything I need to do for a "clean exit"
>back to the desktop.  But I still get 3 bombs when it returns to
>the desktop.  Functionally the program is usable as-is.  But I don't
>like the idea of marketting a product that bombs on exit.  I've
>compiled the program with Sozobon C and I was wonder if this is a
>specific problem with Sozobon.  Or is there something I don't know
>about exiting from GEM?

     I found the answer yesterday!  Many thanks to all who responded.
In fact, though nobody identified the problem exactly, the tip off
was when someone recommended that I try compiling my "initialization"
and "clean exit" sequences separately to make sure the problem was
in that area.  In fact, it made me think a bit more about my code
structure.  Almost all my testing included saving a file before
exiting.  Since the file saved properly, I assumed that that code
was correct.  But it occurred to me that at the end of the routine
I usually 'fflush()' the buffer at the end before returning.  In
fact, I was wondering if I forgot to put it in the code.  Well, it
was there alright, but the problem was that it should NOT have
been there this time.  'fflush()' is only used when you have a
path that's been 'fopen()'d and is pointed to with a type FILE.
The path I was using had been openned by 'open()' and the pointer
was a type 'int'.  The surprising thing is that I didn't seem to
have any crash problems when I ran my program from a text Shell.
Oh well.  It's party time! :-)


-- 
Jim Omura, 2A King George's Drive, Toronto, (416) 652-3880
lsuc!jimomura
Byte Information eXchange: jimomura