我对 CORBA 中的序列序列有疑问。我可以用非优雅的解决方案来解决问题(至少对我来说并不优雅)。
产生内存泄漏的(不是真实的)代码如下:
{
   IntMatrix m;
   m.lenght(100);
   for (int i = 0; i < 100; i++)
   {
      m[i].lenght(99);
   }
   //Send 'm' matrix and exit from this scope
}
(非优雅)解决方案如下:
{
  IntMatrix m;
  m.lenght(100);
  intSeq s;
  s.lenght(99);
  for (int i = 0; i < 100; i++)
  {
      m[i] = s;
  }
  //Send 'm' matrix and exit from this scope
}
我一直在 Internet 上寻找原因,但只能找到有关名为“release”的标志的文本。
有人可以帮助我吗?
谢谢。