Bug1931: more precautions, higher level and more general...
... Do for release as was already done for click and drag: hold a shared pointer. This will protect against reentrancy surprises as in this bug, where a reference to the handle may be removed during one of the handle's own methods.
This commit is contained in:
parent
328aa58966
commit
542adefac1
|
@ -729,13 +729,15 @@ try
|
|||
}
|
||||
else if (event.ButtonUp()) {
|
||||
// UIHANDLE RELEASE
|
||||
// copy shared_ptr for safety, as in HandleClick
|
||||
auto handle = state.mUIHandle;
|
||||
unsigned moreFlags = state.mMouseOverUpdateFlags;
|
||||
UIHandle::Result refreshResult =
|
||||
state.mUIHandle->Release( tpmEvent, GetProject(), this );
|
||||
handle->Release( tpmEvent, GetProject(), this );
|
||||
ProcessUIHandleResult
|
||||
(pClickedCell.get(), pCell.get(),
|
||||
refreshResult | moreFlags);
|
||||
state.mUIHandle.reset(), ClearTargets();
|
||||
state.mUIHandle.reset(), handle.reset(), ClearTargets();
|
||||
state.mpClickedCell.reset();
|
||||
// will also Uncapture() below
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue