Browse Source

Check in change that might help fix a WeakKeyHashMap assert

rdb 10 years ago
parent
commit
b0d8b9109e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      panda/src/putil/weakKeyHashMap.I

+ 4 - 1
panda/src/putil/weakKeyHashMap.I

@@ -710,5 +710,8 @@ expand_table() {
   nassertv(validate());
   nassertv(old_map.validate());
 
-  nassertv(_num_entries == old_map._num_entries);
+  // Note that since has_element(i) also checks whether the pointer
+  // has been deleted, we may end up with fewer entries than we
+  // started with.  Good riddance.
+  nassertv(_num_entries <= old_map._num_entries);
 }