I found a workaround but I do not understand the cause of the problem.
When I change
int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
to
int main ()
{
ACE::init();
and
return 0;
to
ACE::fini();
return (0);
the problem goes away.
I thought ACE_TMAIN kept me from having to call init and fini.
Obviously I did something wrong, can someone explain?