Commits

Aleš Erjavec  committed 78a05ee

Fixed a bug in Table iteration after deleting all elements.

(fixes #1333)

  • Participants
  • Parent commits f1cafef

Comments (0)

Files changed (1)

File source/orange/table.cpp

     delete *ptr;
   memmove(ptr, ptr+1, sizeof(TExample **)*(_Last - ptr - 1));
   _Last--;
+
+  shrinkTable();
   examplesHaveChanged();
 }
 
 
 TExampleIterator TExampleTable::begin()
 {
-  return TExampleIterator(this, examples ? *examples : NULL, (void *)examples);
+  return TExampleIterator(this, (examples && examples != _Last) ? *examples : NULL, (void *)examples);
 }