Fix ASAN warnings in XDGForeignV2Interface
ClosedPublic

Authored by davidedmundson on Dec 13 2017, 10:31 PM.

Details

Summary

The current code captures a char* from a wayland event in a lambda.
By creating the QString first when we capture that by value we'll
implicitly shallow copy it.

The other issue was
someHash.erase(it);
*it->foo();

Even though where the iterator points to is still valid, the iterator
itself is an object that gets modified in erase which ASAN didn't like.

Test Plan

Ran test.
Those particular errors went away
Tests passed

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Dec 13 2017, 10:31 PM
graesslin accepted this revision.Dec 14 2017, 5:45 AM
This revision is now accepted and ready to land.Dec 14 2017, 5:45 AM
This revision was automatically updated to reflect the committed changes.