Maybe I don't know what you exactly mean, but whatever the method you use to quit (menu or click on the X in the right upper corner), GuiView::closeEvent() is called. There you can already find some code for saving geometry and cursor position of opened files.
What I meant was that GuiView::closeEvent should trigger LFUN_WINDOW_CLOSE, and LFUN_BUFFER_CLOSE and let them handle file save, close and clean up. In this way, GUI level cleanup can be done once in one place. To be more specific, I update bookmark in LFUN_BUFFER_CLOSE. This is the only logical place to 'finally check bookmark pit before a buffer is closed'. However, I also need to update bookmarks in LFUN_WINDOW_CLOSE and maybe GuiView::closeEvent. It does not make sense to me at all to call 'quitAndCloseAll' (something like that), instead of sending LFUN_BUFFER_CLOSE to each opened buffer. Bo