aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/compile')
-rw-r--r--gdb/compile/compile-c-support.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c
index c969b42..2614570 100644
--- a/gdb/compile/compile-c-support.c
+++ b/gdb/compile/compile-c-support.c
@@ -75,12 +75,11 @@ c_get_range_decl_name (const struct dynamic_prop *prop)
static gcc_c_fe_context_function *
load_libcc (void)
{
- void *handle;
gcc_c_fe_context_function *func;
/* gdb_dlopen will call error () on an error, so no need to check
value. */
- handle = gdb_dlopen (STRINGIFY (GCC_C_FE_LIBCC));
+ gdb_dlhandle_up handle = gdb_dlopen (STRINGIFY (GCC_C_FE_LIBCC));
func = (gcc_c_fe_context_function *) gdb_dlsym (handle,
STRINGIFY (GCC_C_FE_CONTEXT));
@@ -88,6 +87,9 @@ load_libcc (void)
error (_("could not find symbol %s in library %s"),
STRINGIFY (GCC_C_FE_CONTEXT),
STRINGIFY (GCC_C_FE_LIBCC));
+
+ /* Leave the library open. */
+ handle.release ();
return func;
}