From b0d8b9109e5e9ca3360ff584537241e024d60c4e Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 1 Nov 2015 15:59:38 +0100 Subject: [PATCH] Check in change that might help fix a WeakKeyHashMap assert --- panda/src/putil/weakKeyHashMap.I | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/panda/src/putil/weakKeyHashMap.I b/panda/src/putil/weakKeyHashMap.I index 03987ef866..128936fe20 100644 --- a/panda/src/putil/weakKeyHashMap.I +++ b/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); }