From a4158dd68d12d8672a8f3259ee8447cdb9d2d0a0 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Mon, 29 Jan 2007 21:54:10 +0000 Subject: [PATCH] * libltdl/ltdl.c (lt_dlexit): Fix my bogus backport of Dave Brolley's patch from CVS HEAD. --- ChangeLog | 5 +++++ libltdl/ltdl.c | 15 +++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 67bd215ea..9d941fbd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-01-29 Ralf Wildenhues + + * libltdl/ltdl.c (lt_dlexit): Fix my bogus backport of Dave + Brolley's patch from CVS HEAD. + 2007-01-29 Samuel Thibault * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS) [ gnu ] diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 5435c31e1..bd88414df 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -2341,6 +2341,13 @@ lt_dlexit () lt_dlhandle tmp = cur; cur = cur->next; if (!LT_DLIS_RESIDENT (tmp)) + saw_nonresident = 1; + if (!LT_DLIS_RESIDENT (tmp) && tmp->info.ref_count <= level) + { + if (lt_dlclose (tmp)) + { + ++errors; + } /* Make sure that the handle pointed to by 'cur' still exists. lt_dlclose recursively closes dependent libraries which removes them from the linked list. One of these might be the one @@ -2353,14 +2360,6 @@ lt_dlexit () if (! tmp) cur = handles; } - - saw_nonresident = 1; - if (!LT_DLIS_RESIDENT (tmp) && tmp->info.ref_count <= level) - { - if (lt_dlclose (tmp)) - { - ++errors; - } } } /* done if only resident modules are left */ -- 2.47.3