At 12:19 AM -0700 5/26/99, Christopher Hunt wrote:
>Throughout all of my software I call upon DmCloseDatabase to close a
>database once I'm through with it. I want to know if I have to though...
>would the PalmOS ensure that the database gets closed when my task
>exits?
You should always clean up after yourself, even if the OS currently does
some of it for you. It's just good form.
The only DB you don't have to close is the app itself, which is opened by
the OS before launching. Any DB you open, you also close.
>The reason that I ask is 'cause I have program A calling program B many
>times. For performance reasons I would like program B to keep its
>database open between calls. If the database of program B must be closed
>then I have to introduce another call into B's API, which for
>simplicity, I'd rather not do. Just to make the story more interesting,
>I actually have program A calling B which calls C which calls B again!
What you should probably do is have program A open the database for program
B, and pass the open ref as a paramater when you call B. The same open ref
gets passed on from B to C then back to B again.
...by the way, that's an complicated model you've got going there. Maybe
you want a shared library?
--Bob