Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Memory leak w/OO4O DB object
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.comReceived on Thu Nov 06 1997 - 00:00:00 CST
![]() |
![]() |