Community
I had to bump this long dead post, because I'm having the same problem and all I was able to find was same questions without answers
the only difference is, that I am using VB
(AutoCAD version Civil 2010)
problem solved
the issue was, that my program was not running in session context, so the last drawing couldn't be closed