Fixed memory leak when closing main DB and closing attachment dbs associated to it
Fixed memory leak when closing main DB and closing attachment dbs associated to it

dplatform/dupin,dplatform/dupin,dplatform/dupin,dplatform/dupin