Hi,
When close() returns, the database file
should be closed too, so everything should be saved. On ROS, we must be careful when we kill the launch file "ctrl-c", the process may be killed (escalation to sig-term) before the close() has finished. This can be fixed by increasing the wait time before ros force-kill a node (see
https://answers.ros.org/question/11353/how-to-delay-escalation-to-sig-term-after-sending-sig-int-to-roslaunch/?answer=245912#post-id-245912).
cheers,
Mathieu