From 03cf4aa90122ca671c3026465d4978f191d79231 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Fri, 28 Feb 2014 12:33:05 +0400 Subject: [PATCH] GDTR remove() fix --- libuavcan/src/global_data_type_registry.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libuavcan/src/global_data_type_registry.cpp b/libuavcan/src/global_data_type_registry.cpp index 9920d781ec..734f691367 100644 --- a/libuavcan/src/global_data_type_registry.cpp +++ b/libuavcan/src/global_data_type_registry.cpp @@ -47,12 +47,13 @@ GlobalDataTypeRegistry::RegistResult GlobalDataTypeRegistry::remove(Entry* dtd) if (!list) return RegistResultInvalidParams; - Entry* p = list->get(); + list->remove(dtd); // If this call came from regist<>(), that would be enough + Entry* p = list->get(); // But anyway while (p) { Entry* const next = p->getNextListNode(); if (p->descriptor.match(dtd->descriptor.getKind(), dtd->descriptor.getName())) - list->remove(dtd); + list->remove(p); p = next; } return RegistResultOk;