rld Manual
Using the rld Loader Library
RLD Manual—528857-006
2-9
dlclose()
Examples
In the following program, suppose that library A requires library C (because C is
specified on the libList of A), and that library B also requires library C:
hA = dlopen("A", ...); // loads A and C; links A to C.
hB = dlopen("B", ...); // loads B; links B to already-loaded C
if (perverse) { // close in order of opening
dlclose(hA); // unloads A but not C
dlclose(hB); // unloads B and C
}
else { // close in inverse order of opening
dlclose(hB); // unloads B
dlclose(hA); // unloads A and C
}