Hi Markus,

--- On Thu, Aug 4, 2011 at 5:44 PM, Markus Hoenicka
<markus.hoeni...@mhoenicka.de> wrote:
| I had almost forgotten that bug. That's indeed the most likely reason that
| your test app leaks memory. Unfortunately you're not using an old version as
| 0.8.3 is the latest official release. The bug is fixed in the cvs version
| which, by all means, ist tested, stable, and reliable. I just won't have the
| time to finish a new release until September or so. So if that leak really
| hurts you, you'd have to build libdbi and libdbi-drivers from cvs.
\--

I checked out the latest cvs sources (August 9, 2011). For libdbi, I did:

  $ autogen.sh
  $ ./configure --disable-docs
  $ make
  $ sudo make install

For libdbi-drivers, I used:

  $ autogen.sh
  $ ./configure --with-mysql --with-mysql-libdir=/usr/lib/mysql
--with-mysql-incdir=/usr/include/mysql
--with-dbi-libdir=/usr/local/lib --disable-docs
  $ export LD_LIBRARY_PATH=/usr/local/lib

The API has been changed in the latest source. So, I updated the
following code snippet, and I still see the memory leak:

=== CODE ===

#include <stdio.h>
#include <dbi/dbi.h>

int main()
{
  dbi_conn conn;
  dbi_inst instance;

  dbi_initialize_r(NULL, &instance);

  while (1) {

    conn = dbi_conn_new_r("mysql", instance);

    dbi_conn_set_option(conn, "host", "localhost");
    dbi_conn_set_option(conn, "username", "foo");
    dbi_conn_set_option(conn, "password", "bar");
    dbi_conn_set_option(conn, "dbname", "test");
    dbi_conn_set_option(conn, "encoding", "UTF-8");

    if (dbi_conn_connect(conn) < 0) {
      printf ("Could not connect\n");
    }
    else {
      dbi_conn_close(conn);
    }
  }

  dbi_shutdown_r(instance);
  return 0;

}

=== END ===

Is there anything that I am missing? Appreciate any inputs in this regard,

SK

-- 
Shakthi Kannan
http://www.shakthimaan.com

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
libdbi-users mailing list
libdbi-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-users

Reply via email to