<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.6944.0">
<TITLE>TypeCode_var equivalent memory leak</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">Hi!</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I'm having problems figuring out why the following bit of code leaks. For some reason, the TypeCode equivalent primitive seems to be allocating memory, is this correct behaviour? Am I doing something wrong?</FONT></P>
<P><FONT SIZE=2 FACE="Arial">I would appreciate any help! </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Thanks,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Mike</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">CORBA::Any* EventMgr_impl::pull( const CORBA::Any& Event, Event::queueName_t SourceQ )</FONT>
<BR><FONT SIZE=2 FACE="Arial">{</FONT>
<BR> <FONT SIZE=2 FACE="Arial">METHODTRACE( "CORBA::Any* EventMgr_impl::pull( const CORBA::Any& Event, Event::queueName_t SourceQ )" );</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial">CORBA::Any event;</FONT>
</P>
<P> <FONT SIZE=2 FACE="Arial">if( (SourceQ < Event::MAX_EVENT_QUEUE) && </FONT>
<BR> <FONT SIZE=2 FACE="Arial"> (SourceQ != Event::NULLQ) ) </FONT>
<BR> <FONT SIZE=2 FACE="Arial">{</FONT>
<BR> <FONT SIZE=2 FACE="Arial">if( (!eventQueuesM[SourceQ].queue.empty()) &&</FONT>
<BR> <FONT SIZE=2 FACE="Arial"> (eventQueuesM[SourceQ].queue.back().type()->equivalent(Event.type())) ) <<<<===== This is where it leaks</FONT></P>
<P> <FONT SIZE=2 FACE="Arial">{</FONT>
<BR> <FONT SIZE=2 FACE="Arial">eventQueuesM[SourceQ].notified = FALSE;</FONT>
<BR> <FONT SIZE=2 FACE="Arial">event = eventQueuesM[SourceQ].queue.back();</FONT>
<BR> <FONT SIZE=2 FACE="Arial">eventQueuesM[SourceQ].queue.pop_back();</FONT>
<BR> <FONT SIZE=2 FACE="Arial">return new CORBA::Any(event);</FONT>
<BR> <FONT SIZE=2 FACE="Arial">}</FONT>
<BR> <FONT SIZE=2 FACE="Arial">else</FONT>
<BR> <FONT SIZE=2 FACE="Arial">return NULL;</FONT>
<BR> <FONT SIZE=2 FACE="Arial">}</FONT>
<BR> <FONT SIZE=2 FACE="Arial">else</FONT>
<BR> <FONT SIZE=2 FACE="Arial">{</FONT>
<BR> <FONT SIZE=2 FACE="Arial">LogError("Received pull for unknown queue.");</FONT>
<BR> <FONT SIZE=2 FACE="Arial">throw Event::EventProxy::invalidQ();</FONT>
<BR> <FONT SIZE=2 FACE="Arial">}</FONT>
<BR><FONT SIZE=2 FACE="Arial">}</FONT>
</P>
<P><B><FONT COLOR="#0000FF" FACE="Bookman Old Style">Michael Shearer</FONT></B>
<BR><B><FONT SIZE=1 FACE="Garamond">CVX SS7 Gateway (CSG) Engineer</FONT></B>
<BR><B><FONT SIZE=1 FACE="Garamond">Aastra Telecom US, CVX Division</FONT></B>
<BR><B><FONT SIZE=1 FACE="Garamond">8 Federal Street</FONT></B>
<BR><B><FONT SIZE=1 FACE="Garamond">Billerica, MA, USA, 01821-3570</FONT><BR>
</B><FONT COLOR="#0000FF" SIZE=1 FACE="Wingdings">(</FONT><FONT COLOR="#000000" SIZE=1 FACE="Arial"></FONT> <FONT COLOR="#808080" SIZE=1 FACE="Arial">Phone (978) 436-4248</FONT>
<BR><FONT COLOR="#0000FF" SIZE=1 FACE="Wingdings">(</FONT><FONT COLOR="#000000" SIZE=1 FACE="Arial"></FONT> <FONT COLOR="#808080" SIZE=1 FACE="Arial">Fax (978) 436-4233</FONT><BR>
<FONT COLOR="#0000FF" SIZE=1 FACE="Wingdings">,</FONT><FONT COLOR="#000000" SIZE=1 FACE="Arial"></FONT> <FONT COLOR="#808080" SIZE=1 FACE="Arial">Internet Mail</FONT><U> <FONT COLOR="#0000FF" SIZE=1 FACE="Arial">mshearer@aastra.com</FONT></U><BR>
<FONT COLOR="#0000FF" SIZE=1 FACE="Wingdings">:</FONT><FONT COLOR="#000000" SIZE=1 FACE="Arial"></FONT> <FONT COLOR="#808080" SIZE=1 FACE="Arial">Web</FONT><FONT COLOR="#0000FF" SIZE=1 FACE="Arial"></FONT><U> <FONT COLOR="#0000FF" SIZE=1 FACE="Arial">www.aastra.com</FONT></U>
</P>
</BODY>
</HTML>