1384 |
for (level = 1; handles; ++level) |
for (level = 1; handles; ++level) |
1385 |
{ |
{ |
1386 |
lt_dlhandle cur = handles; |
lt_dlhandle cur = handles; |
1387 |
|
int saw_nonresident = 0; |
1388 |
|
|
1389 |
while (cur) |
while (cur) |
1390 |
{ |
{ |
1391 |
lt_dlhandle tmp = cur; |
lt_dlhandle tmp = cur; |
1392 |
cur = cur->next; |
cur = cur->next; |
1393 |
|
if (!LT_DLIS_RESIDENT (tmp)) |
1394 |
|
saw_nonresident = 1; |
1395 |
if (!LT_DLIS_RESIDENT (tmp) && tmp->info.ref_count <= level) |
if (!LT_DLIS_RESIDENT (tmp) && tmp->info.ref_count <= level) |
1396 |
{ |
{ |
1397 |
if (lt_dlclose (tmp)) |
if (lt_dlclose (tmp)) |
1400 |
} |
} |
1401 |
} |
} |
1402 |
} |
} |
1403 |
|
/* done if only resident modules are left */ |
1404 |
|
if (!saw_nonresident) |
1405 |
|
break; |
1406 |
} |
} |
1407 |
|
|
1408 |
/* close all loaders */ |
/* close all loaders */ |