On Mon, Jan 25, 2016 at 2:44 PM, Teg <Teg at djii.com> wrote: > >>Are you sure you're not somehow double-freeing the sqlite handle? > >>Especially at close I've seen exit() end up calling atexit() methods > >>multiple times in some circumstances... > > "newed" objects never fires the destructor unless you manually destruct > it or use an auto-pointer even when you exit. In fact I use this as a > method to get around destructor order issues when my applications > exit. I essentially just abandon the "new"ed startup objects. It also > makes applications exit faster just to abandon memory and depend on > the OS to reclaim all the memory. >
As you sure the objects that you failed to delete don't *require* some sort of cleanup? Allowing the system to reclaim memory at process termination is fine (though I can't imagine the difference being measurable in most cases and I prefer cleaning up explicitly most of time). That being said, delete also invokes destructors which can do far more than just return memory to the C++ free-store. It's not necessarily related to this precise problem, obviously, just a warning flag that popped up in my reading. -- Scott Robison