Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On Mon, Jul 16, 2012 at 10:15:02PM -0400, Terrence Enger wrote:

I am chasing some "leaked" ODBC statement handles.

I see that ODatabaseMetaDataResultSet.cxx takes care *not* to free a
statement handle which has not been subjected to one of 13 member
functions with names starting "open...".  Questions arising ...

That is a bug. For the history, look at commit
aa3f42832756b7165a0722b2d013a572acf224c8
http://cgit.freedesktop.org/libreoffice/core/commit/?id=aa3f42832756b7165a0722b2d013a572acf224c8

Before that commit the statement handle was passed to the constructor;
the class had not allocated the handle, and thus it was not the
class's role to free it .... (I guess) unless it had taken ownership
of it by actually using it. I'm muddy on how the calling code was
supposed to "know" it should free it "because
ODatabaseMetaDataResultSet did not use it" or it was supposed *not* to
free it "because ODBMetaDataRS used it"; I can easily believe the code
was leaking statement handles in this way even back then (or
double-freeing them or whatever).

Anyway, since this commit, the handle is allocated privately "fresh"
by the class, and it should thus unconditionally free it on dispose;
m_bFreeHandle should die.

To you the honours of writing the patch? Put me as a reviewer, I'll
apply it.

-- 
Lionel

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.