Bob Ebert wrote:

> 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.

Its also good form to release handles when they have been created by oneself.
However fields release handles that have been passed to them i.e. they become
the owner of the handle. One could argue (and I don't want to dwell on this)
that the PalmOS has been given ownership of the database handle... ;-)

> >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.

You're assuming too much about my model i.e. there's more than just a database
involved. Additionally program B's internals i.e. opening a db etc. are
private to program A.

>
>
> ...by the way, that's an complicated model you've got going there.  Maybe
> you want a shared library?

I do not want a shared library.

I know that you're just trying to be helpful here but all I need to know is if
its cool for an app to exit without closing its databases. I get the
impression that it is not.

--
Christopher Hunt
Class Action Pty. Ltd.

Are you a time zone traveler that owns a Palm(tm) connected organizer?
Check out http://www.classactionpl.com/TimeTraveler/index.htm

Reply via email to