Re: Bug in read_bitmap?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jesus writes:
>I'm trying to read a lot of bitmaps from disk with "read_bitmap".
>After reading ten (10) of them, I get an error telling I've open too
> many files.
>Does anybody know if read_bitmap does close the bitmap after reading it?.

Graeme writes:
> Yes, read bitmap closes the file after
> reading it, however it appears it dosn't
> close the file after NOT reading it
> (i.e. when returning an unsupported
> format error).
> The fix is simple; insert "close(fn)"
> before each of the
> "return BMP_UNSUPPORTED_FORMAT"
> lines in the read_bitmap() function,
> in image.e
> I wonder how this one slipped through after
> so long?

Thanks Jesus and Graeme.
I'll fix read_bitmap() for the next release.
It has been that way since v1.3 (3 years ago) and no one
has reported the problem until now. I guess not many
programs open multiple bitmap files
that exist, but are in an unsupported format.

While we're on the subject of bugs, here's one I
encountered yesterday:

If your program executes trace(1) in a section of code that
was not compiled "with trace", nothing will appear to happen,
but the get_key() function will start delaying 8 seconds
on each call, whether there's a key to read or not. Normally,
if you do have "with trace", then trace(1) will open the
interactive trace screen and the 8 second delay on get_key()
is what is supposed to happen, to give you a
chance to enter a keystroke for testing purposes.

This bug might show up as a program that suddenly
seems to "hang" or run extremely slowly compared to normal,
after you start inserting trace() statements.

This will also be fixed for the next release.

Regards,
     Rob Craig
     Rapid Deployment Software

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu