Merge "linker: remove link from external library on unload" into mnc-dev am: 8dee813dfa am: 15db978797
am: 91779f4867
Change-Id: Ifef3f85a01f7deaf7a17c2c562304d3af1361705
diff --git a/linker/linked_list.h b/linker/linked_list.h
index 8003dbf..0572e63 100644
--- a/linker/linked_list.h
+++ b/linker/linked_list.h
@@ -127,7 +127,13 @@
} else {
p->next = next;
}
+
+ if (tail_ == e) {
+ tail_ = p;
+ }
+
Allocator::free(e);
+
e = next;
} else {
p = e;
diff --git a/linker/linker.cpp b/linker/linker.cpp
index d3ac1d0..19f5e94 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -1597,6 +1597,9 @@
if (local_unload_list.contains(child)) {
continue;
} else if (child->is_linked() && child->get_local_group_root() != root) {
+ child->get_parents().remove_if([&] (const soinfo* parent) {
+ return parent == si;
+ });
external_unload_list.push_back(child);
} else {
depth_first_list.push_front(child);