Hi,
So I've got code to trap when a window closes and when my application quits.
I'm observing the NSApplicationWillTerminateNotification notification and saving to the database before the application quits.
Unfortunately I'm finding that the CBLManager is being closed before I get a chance to save to the database.
I looked in the CBL source and the only place I found NSApplicationWillTerminateNotification was in a couple of places that didn't seem like it could cause the database to be closed. One was in CBLRemoteLogging and the other was in DDLog.
Here's what I see right before my termination handler executes:
01:17:11.221| Database: CLOSING CBLManager[0x60c00007f780 /Users/brendan/Library/Containers/com.tapzapp.tapforms-mac/Data/Documents/Contacts Import.tapforms] ...
01:17:11.221| Database: Closing <0x60f000113fe0> /Users/brendan/Library/Containers/com.tapzapp.tapforms-mac/Data/Documents/Contacts Import.tapforms/db-5764caa159814fc7aec294c25c0ec60d.cblite2
01:17:11.224| Database: CLOSED CBLManager[0x60c00007f780 /Users/brendan/Library/Containers/com.tapzapp.tapforms-mac/Data/Documents/Contacts Import.tapforms]
So I'm wondering if there's some other action that's causing the database file to be closed prematurely?
I obviously do want it to close if I quit the app. I just want to save my data before that happens.
Thanks,
Brendan