From 269d154aea28e69dd6f2ac454a2b729c19c06487 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 8 Jul 2018 21:15:40 +0200 Subject: [PATCH] chan: fix thread-unsafe access of WeakPointerTo --- panda/src/chan/partBundle.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/panda/src/chan/partBundle.cxx b/panda/src/chan/partBundle.cxx index dffed55d50..966987995a 100644 --- a/panda/src/chan/partBundle.cxx +++ b/panda/src/chan/partBundle.cxx @@ -154,10 +154,11 @@ apply_transform(const TransformState *transform) { AppliedTransforms::iterator ati = _applied_transforms.find(transform); if (ati != _applied_transforms.end()) { - if ((*ati).first.is_valid_pointer() && - (*ati).second.is_valid_pointer()) { - // Here's our cached result. - return (*ati).second.lock(); + if ((*ati).first.is_valid_pointer()) { + if (auto new_bundle = (*ati).second.lock()) { + // Here's our cached result. + return new_bundle; + } } }