At 6:38 PM -0700 5/26/99, Christopher Hunt wrote:
>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... ;-)
I think you're right about the field code and the text handle. If the
field code allocated the handle itself, it should free it. If it was
passed it, it should not.
Unfortunately, it's too late to change--too many apps rely on the current
behavior. If/when we do a next generation OS that breaks compatibility,
stuff like that will get fixed.
>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.
Sorry, I guess I assumed you knew less about what you're doing than you
seem to. I'm almost positive the OS will NOT close databases for you when
your app exits. If you have the source license, you might want to look at
the inside of SysAppLaunch.
I say almost positive because... well... the database management stuff in
app launching is a little confusing, especially with all the odd cases re:
globals or not, different launch codes, etc.
So, if you're hacking you might want to try this and see what it does to
performance.
But let me restate that in general it's proper for your app to close
everything before it exits.
And I still think having the top level app open the databases is a cleaner
and safer way to go, if you can organize your code that way. If the
paramater passing is a pain, maybe stuff the open refs in features for the
other apps to get at.
--Bob
_______________________________________________________________________
Bob Ebert, Sr. Software Engineer, Palm Computing Inc., 3Com Corporation
V: 408 326-9299 5400 Bayfront Plaza, MS: 10212, Santa Clara, CA, 95052
F: 408 326-9891, [EMAIL PROTECTED] (preferred: [EMAIL PROTECTED])