Skip to content

Commit 40f52f6

Browse files
foleyjpgouriano
authored andcommitted
JIRA: RW-2383 Cleanup user object must be removed when extended cleanup is disabled. Empty descriptor fields should be reset
git-svn-id: https://anonsvn.ncbi.nlm.nih.gov/repos/v1/trunk/c++@103508 78c7ea69-d796-4a43-9a09-de51944f1b03
1 parent bf15ea6 commit 40f52f6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/app/asn_cleanup/huge_file_cleanup.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@ void CCleanupHugeAsnReader::x_CleanupTopLevelDescriptors()
185185
CCleanup cleanup;
186186
m_Changes += *cleanup.BasicCleanup(m_top_entry->SetDescr());
187187

188+
if (m_CleanupOptions & eRemoveNcbiUserObjects) {
189+
CCleanup::RemoveNcbiCleanupObject(m_top_entry->SetDescr());
190+
if (! m_top_entry->GetDescr().IsSet() ||
191+
m_top_entry->GetDescr().Get().empty()) {
192+
m_top_entry->SetSet().ResetDescr();
193+
}
194+
}
195+
188196
if (!x_IsExtendedCleanup()) {
189197
return;
190198
}
@@ -217,10 +225,6 @@ void CCleanupHugeAsnReader::x_CleanupTopLevelDescriptors()
217225
m_Changes.SetChanged(CCleanupChange::eAddNcbiCleanupObject);
218226
}
219227

220-
if (m_CleanupOptions & eRemoveNcbiUserObjects) {
221-
CCleanup::RemoveNcbiCleanupObject(m_top_entry->SetDescr());
222-
}
223-
224228
if (descriptors.empty()) {
225229
m_top_entry->SetSet().ResetDescr();
226230
}

0 commit comments

Comments
 (0)