Here is my code
try
theDatabase.Close
theDatabase = nil
catch err as VException
if err.ErrorNumber = 394507 then
'just ignore
end if
end try
'make sure that the journal file is really deleted
if DBFolderitem <> nil then
dim JournalFile as FolderItem = DBFolderitem.Parent.Child(DBFolderitem.Name + ".journal")
if JournalFile <> nil and JournalFile.Exists then
'extra logging
Globals.theErrorLog.logitem(currentMethodName + " " + JournalFile.NativePath)
JournalFile.Delete
''extra logging
Globals.theErrorLog.logitem(currentMethodName + " " + str(JournalFile.LastErrorCode))
end if
end if
The data from the session log shows that the journal file is still there. Even the ".delete" doesn't help even if the last error code is 0.
2018-10-23, 19:48:57 MainWindowController.CheckForQuit
2018-10-23, 19:48:57 DBWindow.CloseArchive
2018-10-23, 19:48:57 MainWindowController.CloseArchive
2018-10-23, 19:48:57 MaxModel.CloseArchive
2018-10-23, 19:48:57 MaxModel.CloseArchive done
2018-10-23, 19:48:57 MainWindowController.CloseArchive done
2018-10-23, 19:48:57 MainWindow.CloseDB
2018-10-23, 19:48:57 MainWindow.CloseDB /Users/christian/Mail Archive.vdb.journal
2018-10-23, 19:48:57 MainWindow.CloseDB 0
2018-10-23, 19:48:57 MainWindow.CloseDB done
2018-10-23, 19:48:57 DBWindow.CloseArchive done
When the user only closes the database the journal file is deleted. I think that there may be a relationship to a bug in Xojo that makes 64bit apps not quit. As workaround I have to use a declare to quit my app:
declare function NSClassFromString lib "Cocoa" ( aClassName as CFStringRef ) as integer
declare function sharedApplication lib "Cocoa" selector "sharedApplication" ( classRef as integer ) as integer
declare sub terminate lib "Cocoa" selector "terminate:" ( appRef as integer, sender as integer )
Dim appInstance as integer = sharedApplication( NSClassFromString( "NSApplication" ) )
terminate( appInstance, appInstance )
Any idea what I could do to make sure that the journal file is deleted before the quit is done?
Xojo 2018r1, Valentina 8.3.3.
Mit freundlichen Grüßen/Regards
Beatrix Willius
http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals