[omniORB] Memory leak on _default () of union

Daniel Laügt daniel.laugt at wallstreetsystems.com
Tue Apr 5 18:47:07 BST 2016


>> There is a memory leak caused by the following revision:
>> http://sourceforge.net/p/omniorb/svn/5934/
>>
>> _default() of union should release its member.
>>
>Thanks for the bug report. Yes, _default() should call _release_member().
>I've fixed it in svn, in the 4_2 branch.

Thanks for the fix.
There is still a memory leak in one scenario of union.

test.idl:
module Test
{
  struct Money
  {
    double m;
  };

  union nullable_money switch (boolean) { case TRUE: Money v; };
};

test.cc:
#include <idl/Test.h>
int main ()
{
  Test::Money a;
  a.m = 1;

  Test::nullable_money b;
  b.v (a);

  Test::nullable_money c;
  b = c; // memory leak

  return 0;
}

Regards,
Daniel.



More information about the omniORB-list mailing list