Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Memory leak w/OO4O DB object

Memory leak w/OO4O DB object

From: Ron Davis <red_at_synchrony.com>
Date: 1997/11/06
Message-ID: <01bceacb$49e2eb00$0e00a8c0@red.synchrony.com>#1/1

I'm having a memory leak problem using Oracle Objects for OLE Version 2.0 with Visual C++. The following section of code checks to see if the database is open. If it is not it attempts to open a connection.

My problem is that when the Open() fails, OO4O does not seem to clean up all allocated memory, in spite of calling both a Close() and ~ODatabase() destructor. Repeated unsuccessful calls to this code seems to consume an additional 50K of Virtual Memory each time this section of code is called.

This code is going into an unattended 7 day X 24 hr application.

Does anyone know of another way to implement this functionality with OO4O without causing the memory leak?

        ODatabase m_datab;

	if(!m_datab.IsOpen())
	{
		m_datab.Close();
		m_datab.~ODatabase();
		ores = m_datab.Open(m_strDBName, m_strUnamePW, NULL);
		if (ores != OSUCCESS)
		{
			m_datab.Close();
			m_datab.~ODatabase();
			return FALSE;
		}
	}


-- 
TIA,
Ron Davis
red_at_synchrony.com
www.synchrony.com
Received on Thu Nov 06 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US