Ensure the helpers closures don't access invalid pointers
ClosedPublic

Authored by ervin on Sep 23 2015, 8:28 PM.

Details

Summary

The closures returned by the LiveQueryHelpers class use the serializer
and storage pointers of the helpers object. But the lifetime of those
pointers is tied to the helpers object, so we access invalid pointers if
one of the closures is invoked after the deletion of the helpers object.

So instead of "this" we capture the actual pointers in the closures.
Since they are shared pointers, the used objects will stay valid for the
whole life time of the closure.

Again a mistake which was spotted thanks to the ASAN build.

Diff Detail

Repository
R4 Zanshin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ervin updated this revision to Diff 913.Sep 23 2015, 8:28 PM
ervin retitled this revision from to Ensure the helpers closures don't access invalid pointers.
ervin updated this object.
ervin edited the test plan for this revision. (Show Details)
ervin added reviewers: bensi, franckarrecot.
bensi accepted this revision.Sep 24 2015, 1:02 PM
bensi edited edge metadata.
This revision is now accepted and ready to land.Sep 24 2015, 1:02 PM
This revision was automatically updated to reflect the committed changes.