From 8339628dfd78f7d7e20f0fdd771c6a3c01ac43f9 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 23 Mar 2014 18:04:23 +0000 Subject: [PATCH] if VALGRIND is defined, do not unload the driver. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14852 67ed7778-7388-44ab-90cf-0a291f65f57c --- libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c | 2 ++ libgphoto2_port/libgphoto2_port/gphoto2-port.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c b/libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c index fb435156a..bd67a64af 100644 --- a/libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c +++ b/libgphoto2_port/libgphoto2_port/gphoto2-port-info-list.c @@ -248,7 +248,9 @@ foreach_func (const char *filename, lt_ptr data) } result = lib_list (list); +#if !defined(VALGRIND) lt_dlclose (lh); +#endif if (result < 0) { gp_log (GP_LOG_DEBUG, "gphoto2-port-info-list", _("Could not load port driver list: '%s'."), diff --git a/libgphoto2_port/libgphoto2_port/gphoto2-port.c b/libgphoto2_port/libgphoto2_port/gphoto2-port.c index 56d1f4fe8..571f364e7 100644 --- a/libgphoto2_port/libgphoto2_port/gphoto2-port.c +++ b/libgphoto2_port/libgphoto2_port/gphoto2-port.c @@ -167,8 +167,10 @@ gp_port_set_info (GPPort *port, GPPortInfo info) port->pc->ops = NULL; } if (port->pc->lh) { +#if !defined(VALGRIND) lt_dlclose (port->pc->lh); lt_dlexit (); +#endif } lt_dlinit (); @@ -348,8 +350,10 @@ gp_port_free (GPPort *port) } if (port->pc->lh) { +#if !defined(VALGRIND) lt_dlclose (port->pc->lh); lt_dlexit (); +#endif port->pc->lh = NULL; }