Title: Crash while assigning ObjectID's

Hi,

I have some problems with a some code generating crashes on Windows but not on Linux.
On Windows I'm using mico 2.3.12 compiled with Intel 9.0.
On Linux I'm using mico 2.3.11 compiled with gcc 3.2.3.

The problematic code is as follows:

  PortableServer::ServantBase_var servant;
  std::map<EFactoryType, ObjectID> factories;

  // create calculator factories
  // ---------------------------
  // create F1 calculator factory
  servant = new F1FactoryImpl();
  PortableServer::ObjectId_var oid = _poa->activate_object(servant);
  factories.insert(make_pair(F2Calculator, oid));

  // create F2 calculator factory
  servant = new F2FactoryImpl();
  oid = _poa->activate_object(servant);
  factories.insert(make_pair(F2Calculator, oid));

  // create F3 calculator factory
  servant = new F3FactoryImpl();
  oid = _poa->activate_object(servant);
  factories.insert(make_pair(F3Calculator, oid));

The crash occurs when the assigning the ObjectId of the second calculator to the oid variable.
The program tries to free memory that is already freed or (more likely) is allocated in the mico dll.

What am I doing wrong and how should I solve this problem?

Regards,

Eric Zuur

_______________________________________________
Mico-devel mailing list
[email protected]
http://www.mico.org/mailman/listinfo/mico-devel

Reply via email to