[Insight-developers] ObjectFactory memory leaks
Miller, James V (CRD)
millerjv@crd.ge.com
Mon, 19 Nov 2001 11:26:52 -0500
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C17116.FF27EB70
Content-Type: text/plain;
charset="iso-8859-1"
I think the atexit approach is the right way to resolve this. The other option is to have Purify
ignore the this error.
-----Original Message-----
From: Aljaz Noe [mailto:noe@grasp.cis.upenn.edu]
Sent: Monday, November 19, 2001 10:59 AM
To: Insight-Developers
Subject: [Insight-developers] ObjectFactory memory leaks
Hi!
I noticed that the ObjectFactoryBase does not release the allocated member m_RegisteredFactories when
the application finishes. Technically this is not a memory leak, since the memory is definitely
allocated only once and is released by OS when the application quits. It is however a bit annoying,
when searching for true memory leaks caused by bugs in other parts of code.
Is this behavior by design, or is it a bug (feature???) in ObjectFactoryBase?
The above problem can be eliminated quite easy by using the atexit function, but I might not be aware
of all the consequences. It seems to work on VC++, though.
Aljaz
------_=_NextPart_001_01C17116.FF27EB70
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=419512416-19112001><FONT color=#0000ff size=2>I think the
atexit approach is the right way to resolve this. The other option is to
have Purify ignore the this error.</FONT></SPAN></DIV>
<DIV><SPAN class=419512416-19112001></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Aljaz Noe
[mailto:noe@grasp.cis.upenn.edu]<BR><B>Sent:</B> Monday, November 19, 2001
10:59 AM<BR><B>To:</B> Insight-Developers<BR><B>Subject:</B>
[Insight-developers] ObjectFactory memory leaks<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=500384915-19112001>Hi!</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=500384915-19112001></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=500384915-19112001>I noticed that the
ObjectFactoryBase does not release the allocated member m_RegisteredFactories
when the application finishes. Technically this is not a memory leak, since
the memory is definitely allocated only once and is released by OS when the
application quits. It is however a bit annoying, when searching for true
memory leaks caused by bugs in other parts of code.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=500384915-19112001></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=500384915-19112001>Is this behavior
by design, or is it a bug (feature???) in
ObjectFactoryBase?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=500384915-19112001></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=500384915-19112001>The above problem
can be eliminated quite easy by using the atexit function, but I might not be
aware of all the consequences. It seems to work on VC++,
though.</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Aljaz</FONT></DIV>
<DIV> </DIV></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C17116.FF27EB70--